Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 3.0 DEFINE FUNCTION cipher(templist):
- 3.1 SET cipherText to “ “
- 3.2 FOR EACH character IN templist[2] DO:
- 3.3 SET character TO ASCII_CODE + 2
- 3.4 ADD character TO cipherText
- 3.5 RETURN cipherText
- 2.0 DEFINE FUNCTION navigate(scavengerList):
- 2.1.1 SET index TO 0
- 2.1.2 SET condition TO True
- 2.1.3 SEND scavengerList[0].lat TO DISPLAY
- 2.1.4 SEND scavengerList[0].lon TO DISPLAY
- 2.1.5 SEND scavengerList[0].msg TO DISPLAY
- 2.1.6 SEND scavengerList[0].cipher TO DISPLAY
- 2.1.7 RECIEVE choice FROM KEYBOARD
- 2.1.8 WHILE condition IS True DO:
- 2.1.9 WHILE choice = "d" DO:
- 2.2.0 SET index TO index + 1
- 2.2.1 IF index > 4 DO:
- 2.2.2 SET index TO 0
- 2.2.3 ENDIF
- 2.2.4 SEND scavengerList[index].lat TO DISPLAY
- 2.2.5 SEND scavengerList[index].lon TO DISPLAY
- 2.2.6 SEND scavengerList[index].msg TO DISPLAY
- 2.2.7 SEND scavengerList[index].cipher TO DISPLAY
- 2.2.8 RECIEVE choice FROM KEYBOARD
- 2.2.9 ENDWHILE
- 2.3.0 WHILE choice = "a" DO:
- 2.3.1 SET index TO index - 1
- 2.3.2 IF index < 0 DO:
- 2.3.3 SET index TO 4
- 2.3.4 ENDIF
- 2.3.5 SEND scavengerList[index].lat TO DISPLAY
- 2.3.6 SEND scavengerList[index].lon TO DISPLAY
- 2.3.7 SEND scavengerList[index].msg TO DISPLAY
- 2.3.8 SEND scavengerList[index].cipher TO DISPLAY
- 2.3.9 RECIEVE choice FROM KEYBOARD
- 2.4.0 ENDWHILE
- 2.4.1 ELSE DO:
- 2.4.2 SEND “Error wrong input” TO DISPLAY
- 2.4.3 RECEIVE choice FROM KEYBOARD
- 2.4.4 ENDWHILE
- 1.0 DEFINE CLASS scavenger:
- 1.1.0 SET lat TO ""
- 1.1.1 SET lon TO ""
- 1.1.2 SET msg TO ""
- 1.1.3 SET cipher to ""
- 1.1.4 SET scavengerList TO []
- 1.1.5 OPEN FILE "messages.txt" INTO myFileList BY LINES
- 1.1.6 FOR item IN myFileList DO:
- 1.1.7 SET templist TO []
- 1.1.8 SET templist TO item.SPLIT(",")
- 1.1.9 SET cipherText TO CALLFUNCTION cipher(templist)
- 1.2.0 SET tempObject TO CLASS scavenger()
- 1.2.1 SET tembObject.lat TO templist[0]
- 1.2.1 SET tembObject.lon TO templist[1]
- 1.2.2 SET tembObject.msg TO templist[2]
- 1.2.3 SET tembObject.cipher TO cipherText
- 1.2.4 APPEND tempObject TO scavengerList
- 1.2.5 CALL FUNCTION navigate(scavengerList)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement