Advertisement
Guest User

harveycode

a guest
Feb 24th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. 3.0 DEFINE FUNCTION cipher(templist):
  2. 3.1 SET cipherText to “ “
  3. 3.2 FOR EACH character IN templist[2] DO:
  4. 3.3 SET character TO ASCII_CODE + 2
  5. 3.4 ADD character TO cipherText
  6. 3.5 RETURN cipherText
  7.  
  8. 2.0 DEFINE FUNCTION navigate(scavengerList):
  9. 2.1.1 SET index TO 0
  10. 2.1.2 SET condition TO True
  11. 2.1.3 SEND scavengerList[0].lat TO DISPLAY
  12. 2.1.4 SEND scavengerList[0].lon TO DISPLAY
  13. 2.1.5 SEND scavengerList[0].msg TO DISPLAY
  14. 2.1.6 SEND scavengerList[0].cipher TO DISPLAY
  15. 2.1.7 RECIEVE choice FROM KEYBOARD
  16. 2.1.8 WHILE condition IS True DO:
  17. 2.1.9 WHILE choice = "d" DO:
  18. 2.2.0 SET index TO index + 1
  19. 2.2.1 IF index > 4 DO:
  20. 2.2.2 SET index TO 0
  21. 2.2.3 ENDIF
  22. 2.2.4 SEND scavengerList[index].lat TO DISPLAY
  23. 2.2.5 SEND scavengerList[index].lon TO DISPLAY
  24. 2.2.6 SEND scavengerList[index].msg TO DISPLAY
  25. 2.2.7 SEND scavengerList[index].cipher TO DISPLAY
  26. 2.2.8 RECIEVE choice FROM KEYBOARD
  27. 2.2.9 ENDWHILE
  28. 2.3.0 WHILE choice = "a" DO:
  29. 2.3.1 SET index TO index - 1
  30. 2.3.2 IF index < 0 DO:
  31. 2.3.3 SET index TO 4
  32. 2.3.4 ENDIF
  33. 2.3.5 SEND scavengerList[index].lat TO DISPLAY
  34. 2.3.6 SEND scavengerList[index].lon TO DISPLAY
  35. 2.3.7 SEND scavengerList[index].msg TO DISPLAY
  36. 2.3.8 SEND scavengerList[index].cipher TO DISPLAY
  37. 2.3.9 RECIEVE choice FROM KEYBOARD
  38. 2.4.0 ENDWHILE
  39. 2.4.1 ELSE DO:
  40. 2.4.2 SEND “Error wrong input” TO DISPLAY
  41. 2.4.3 RECEIVE choice FROM KEYBOARD
  42. 2.4.4 ENDWHILE
  43.  
  44. 1.0 DEFINE CLASS scavenger:
  45. 1.1.0 SET lat TO ""
  46. 1.1.1 SET lon TO ""
  47. 1.1.2 SET msg TO ""
  48. 1.1.3 SET cipher to ""
  49. 1.1.4 SET scavengerList TO []
  50. 1.1.5 OPEN FILE "messages.txt" INTO myFileList BY LINES
  51. 1.1.6 FOR item IN myFileList DO:
  52. 1.1.7 SET templist TO []
  53. 1.1.8 SET templist TO item.SPLIT(",")
  54. 1.1.9 SET cipherText TO CALLFUNCTION cipher(templist)
  55. 1.2.0 SET tempObject TO CLASS scavenger()
  56. 1.2.1 SET tembObject.lat TO templist[0]
  57. 1.2.1 SET tembObject.lon TO templist[1]
  58. 1.2.2 SET tembObject.msg TO templist[2]
  59. 1.2.3 SET tembObject.cipher TO cipherText
  60. 1.2.4 APPEND tempObject TO scavengerList
  61. 1.2.5 CALL FUNCTION navigate(scavengerList)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement