Advertisement
misoloo

TI-84 Plus CE | Snake

Dec 1st, 2016
1,816
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. Lbl P
  2. 0→Xmin
  3. 264→Xmax
  4. ­164→Ymin
  5. 0→Ymax
  6. BackgroundOn BLACK
  7. 1→W
  8.  
  9. Lbl L
  10. If W>dim(⌊SNAKE)/4:Return
  11. ClrDraw
  12. 5→L:5→A:5→B:1→C:0→D
  13. A+C→G:B+D→H
  14. 10→J
  15. L→dim(L₁
  16. L→dim(L₂
  17. Fill(A,L₁
  18. Fill(B,L₂
  19.  
  20. For(X,1,4
  21. ⌊SNAKE(4W-4+X→N
  22. If N>0:Then
  23. int(N/16→P
  24. N-P*16→N
  25. int(N/14→Q
  26. N-Q*14→N
  27. int(N/12→R
  28. N-R*12→N
  29. int(N→S
  30. For(U,P,R
  31. For(V,Q,S
  32. Pt-On(6U,­6V,2,12
  33. Pt-On(6U,­6V,20
  34. End:End
  35. End:End
  36. W+1→W
  37.  
  38. getKey→K
  39. Lbl GL
  40. While 1
  41. getKey→K
  42. If K≠0:Then
  43. If K=24 and C=0
  44. Then:­1→C:0→D:End
  45. If K=26 and C=0
  46. Then:1→C:0→D:End
  47. If K=25 and D=0
  48. Then:­1→D:0→C:End
  49. If K=34 and D=0
  50. Then:1→D:0→C:End
  51. End
  52. A+C→A:B+D→B
  53. If A>43:1→A
  54. If A<1:43→A
  55. If B>27:1→B
  56. If B<1:27→B
  57.  
  58. If A=G and B=H:Then
  59. L+1→L
  60. Pt-Off(6G,­6H
  61. If L≥20:Goto L
  62. Lbl GH
  63. randInt(1,43→G
  64. randInt(1,26→H
  65. If pxl-Test(6H,6G) or pxl-Test(6H-2,6G-2):Goto GH
  66. Pt-On(6G,­6H,11
  67. Else
  68. If pxl-Test(6B-2,6A-2:Goto E
  69. End
  70.  
  71. J+4→J
  72. If J>14:10→J
  73. Pt-On(6A,­6B,2,J
  74. Pt-Off(6E,­6F,2
  75.  
  76. augment({A},L₁)→L₁
  77. augment({B},L₂)→L₂
  78. L→dim(L₁
  79. L→dim(L₂
  80. L₁(L→E
  81. L₂(L→F
  82.  
  83. End
  84.  
  85. Lbl E
  86. Pt-On(6A,­6B,11
  87. TextColor(RED
  88. Text(70,95," GAME OVER
  89. Text(84,95," SCORE: "
  90. Text(84,143,15(W-2)+L-6
  91. Pause
  92. Goto P
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement