Advertisement
Dddunlavy09

Snake for Ti-84 Plus CE

Aug 31st, 2022 (edited)
14,069
0
Never
11
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | Source Code | 0 0
  1. ClrHome
  2. 0→G
  3. 1→C
  4. 1→S
  5. 3→X
  6. 3→Y
  7. 3→V
  8. 3→U
  9. 2→D
  10. 0→T
  11. DelVar [A]
  12. {10,26→dim([A]
  13. For(F,1,5
  14. randInt(1,10→O
  15. randInt(1,26→P
  16. 5→[A](O,P
  17. Output(O,P,"*
  18. End
  19. While C and G≠45
  20. Output(Y,X,0
  21. If [A](Y,X)>1
  22. Then
  23. S+1→S
  24. 0→T
  25. While [A](O,P)≠0
  26. randInt(1,10→O
  27. randInt(1,26→P
  28. If [A](Y,X)≠5 or S≥200
  29. 0→C
  30. End
  31. 5→[A](O,P
  32. Output(O,P,"*
  33. End
  34. getKey→G
  35. If G=24 and D≠2
  36. 4→D
  37. If G=25 and D≠3
  38. 1→D
  39. If G=26 and D≠4
  40. 2→D
  41. If G=34 and D≠1
  42. 3→D
  43. D→[A](Y,X
  44. X+(D=2)-(D=4→X
  45. Y+(D=3)-(D=1→Y
  46. If Y>10 or Y<1 or X>26 or X<1
  47. 0→C
  48. Output(V,U," //one space
  49. If T=1
  50. Then
  51. [A](V,U→K
  52. 0→[A](V,U
  53. U+(K=2)-(K=4→U
  54. V+(K=3)-(K=1→V
  55. End
  56. 1→T
  57. End
  58. ClrHome
  59. Output(4,5,"GAME OVER
  60. If S≥200
  61. Output(4,5,"YOU WIN!!
  62. Output(5,5,"SCORE:
  63. Output(5,12,S
  64. "
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement