Advertisement
Zeda

Yahtzee_Axe_Acag

Feb 5th, 2016
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. .YAHTZEE
  2. .Yahtzee, Axe Version
  3. #ExprOff
  4. Fix 5
  5. UnArchive Str0A
  6. GetCalc(Str0A)->P
  7. !If P
  8. GetCalc(Str0A,33)->P
  9. Fill(P,33,0)
  10. End
  11. ClrHome
  12. Lbl SPLASH
  13. Fix 1
  14. Text(0,0,Str1
  15. Text(28,7,"YAHTZEE"
  16. Text(0,14,Str1
  17. Fix 0
  18. Text(28,21,"Version 2.0b"
  19. Bitmap(34,31,ROLL()*26+Pic0
  20. Bitmap(46,31,ROLL()*26+Pic0
  21. Text(0,50,"by Anthony Cagliano")
  22. Text(0,56,"http://clrhome.org")
  23. DispGraph
  24. getKey^^r
  25.  
  26. Lbl MAINMENU
  27. ClrDraw
  28. Fix 1
  29. Text(0,0,Str1
  30. Text(22,7,"MAIN MENU"
  31. Text(0,14,Str1
  32. Fix 0
  33. Text(5,24,"New Game"
  34. Text(5,30,"Continue"
  35. Text(5,36,"Credits"
  36. Text(5,42,"Exit"
  37. DispGraph
  38. 0->L->G
  39. Repeat G=5
  40. Text(0,L*6+24,">"
  41. DispGraph
  42. Text(0,L*6+24," "
  43. getKey^^r->G
  44. L+(G=4)-(G=3)plotdot3->L
  45. End
  46. If L=1:Goto CONTINUE:End
  47. If L=2:Goto CREDITS:End
  48. If L=3:Goto EXIT:End
  49. Lbl NEWGAME
  50. {L1+12}^^r->Q
  51. Fill(L1,33,0)
  52. Q->{L1+12}^^r
  53. 2->{L1+31}
  54. Goto GAMEST
  55.  
  56. Lbl CONTINUE
  57. Copy(P,L1,33)
  58. Lbl GAMEST
  59. DispGraph
  60. Lbl GAMELOOP
  61. ClrDraw
  62. sub(DRAWDIE)
  63. sub(DRAWSCRS)
  64. sub(DRAWSELSC)
  65. cumSum(L1+16,13)->T
  66. If T>=13
  67. Fix 1
  68. Text(30,36,"GAME OVER"
  69. Text(30,42,"Press ENTER"
  70. DispGraph
  71. Repeat getKey(5)
  72. End
  73. ClrHome
  74. ClrDraw
  75. Fix 0
  76. Goto NEWGAME
  77. End
  78. DispGraph
  79. getKey^^r->G
  80. If G=9
  81. Goto MAINMENU
  82. End
  83. If G=69
  84. sub(SHOWHELP)
  85. End
  86. !If {L1+31}
  87. Goto NOROLL
  88. End
  89. If {L1+31}=1
  90. Goto NOROLL
  91. End
  92. If G=4
  93. sub(ROLLDIE)
  94. End
  95. If G=73
  96. {L1+5}=0->{L1+5}
  97. End
  98. If G=72
  99. {L1+6}=0->{L1+6}
  100. End
  101. If G=46
  102. {L1+7}=0->{L1+7}
  103. End
  104. If G=90
  105. {L1+8}=0->{L1+8}
  106. End
  107. If G=68
  108. {L1+9}=0->{L1+9}
  109. End
  110. !If {L1+31}
  111. Goto GAMELOOP
  112. End
  113. If {L1+31}=2
  114. Goto GAMELOOP
  115. End
  116. Lbl NOROLL
  117. If G=2
  118. If {L1+30}
  119. {L1+30}-1->{L1+30}
  120. End:End
  121. If G=1
  122. If {L1+30}<12
  123. {L1+30}+1->{L1+30}
  124. End:End
  125. If G=5
  126. {L1+14}^^r->S
  127. {L1+10}^^r->N
  128. {L1+30}->C
  129. If {L1+16+C}!=1
  130. 1->{L1+16+C}
  131. S+N->N
  132. 2->{L1+31}^^r
  133. If C<6
  134. {L1+33}+S->{L1+33}
  135. End
  136. Fill(L1+5,5,0
  137. If (C=12) and ({L1+28}=1)
  138. 1->{L1+31}
  139. End
  140. If {L1+33}>=63
  141. N+35->N
  142. End
  143. N->{L1+10}^^r
  144. End
  145. End
  146. Goto GAMELOOP
  147.  
  148. Lbl ROLLDIE
  149. For(theta,0,4)
  150. !If {L1+5+theta}
  151. ROLL()->{L1+theta}
  152. End
  153. End
  154. {L1+32}+1->{L1+32}
  155. 3->{L1+31}
  156. Return
  157.  
  158.  
  159. Lbl DRAWDIE
  160. For(theta,0,4)
  161. Bitmap(12*theta+6,44,{L1+theta}*26+Pic0)
  162. End
  163. 3-{L1+32}->R
  164. Fix 1
  165. Text(75,48,R>Dec
  166. !If R
  167. Text(75,48,"S")
  168. End
  169. Fix 0
  170. !If R
  171. 1->{L1+31}
  172. End
  173. For(theta,0,4)
  174. If {L1+5+theta}=1
  175. Text(12*theta+11,56,"H"
  176. End
  177. End
  178. Return
  179.  
  180. Lbl DRAWSELSC
  181. {L1+30}->S
  182. stdDev(Str9,S)->W
  183. Text(28,24,W
  184. If ({L1+16+S}=1) and (S!=12)
  185. Text(30,30,"Used"
  186. Return
  187. End
  188. If S<6
  189. 0->N
  190. For(theta,0,4)
  191. If {L1+theta}=(S+1)
  192. N+1->N
  193. End
  194. End
  195. N*(S+1)->T
  196. End
  197. If S=6 or S=7
  198. For(Z,1,6)
  199. 0->N
  200. For(theta,0,4)
  201. If {L1+theta}=Z
  202. N+1->N
  203. End
  204. End
  205. If N>=3
  206. 6->Z
  207. End
  208. End
  209. 0->T
  210. If (N>=3) and (S=6)
  211. cumSum(L1,5)->T
  212. End
  213. If (N>=4) and S=7)
  214. cumSum(L1,5}->T
  215. End
  216. End
  217. If S=8
  218. For(theta,0,4)
  219. {L1+theta}->{L2+theta}
  220. End
  221. SortD(L2,5)
  222. 0->N:0->Z
  223. For(theta,0,3)
  224. If (theta>0) and (theta<3) and ({L2+theta}>{L2+1+theta})
  225. N+1->N
  226. End
  227. {L2+theta}={L2+1+theta}+Z->Z
  228. End
  229. 0->T
  230. If (Z=3) and (N=1)
  231. 25->T
  232. End
  233. End
  234. If S-9<2
  235. For(theta,0,4)
  236. {L1+theta}->{L2+theta}
  237. End
  238. SortD(L1,5)
  239. 0->N
  240. For(theta,0,3)
  241. {L2+theta}-{L2+1+theta}=1+N->N
  242. End
  243. 0->T
  244. If (N=4) and (S=10)
  245. 40->T
  246. End
  247. If (N>=3) and (S=9)
  248. 30->T
  249. End
  250. End
  251. If S=11
  252. cumSum(L1,5)->T
  253. End
  254. If S=12
  255. {L1}->N
  256. 1->Z
  257. For(theta,0,3)
  258. {L1+1+theta}=N and Z->Z
  259. End
  260. 0->T
  261. If Z
  262. 50->T
  263. End
  264. End
  265. Text(34,30,T>Dec
  266. T->{L1+14}^^r
  267. Return
  268.  
  269. Lbl DRAWSCRS
  270. {L1+10}^^r->S
  271. {L1+12}^^r->H
  272. Text(0,0,"GAME SCORE"
  273. Text(55,0,"HIGH SCORE"
  274. Fix 1
  275. Text(0,7,S>Dec
  276. Text(60,7,H>Dec
  277. Fix 0
  278. Return
  279.  
  280. Lbl SHOWHELP
  281. Return
  282.  
  283.  
  284. Lbl CREDITS
  285.  
  286. Lbl EXIT
  287. Fix 4
  288. Fix 0
  289. {P+12}^^r->Q
  290. Copy(L1,P,33)
  291. Q->{P+12}^^r
  292. Archive Str0A
  293. ClrDraw
  294. Return
  295. Lbl ROLL
  296. rand
  297. Asm(AF444D291709CE00291726006F23)
  298. Return
  299. .SPRITES
  300.  
  301. [0C0CFFF08010801080108010801080108010801080108010FFF0]->Pic0
  302. [0C0CFFF08010801080108010861086108010801080108010FFF0]
  303. [0C0CFFF08010801086108610801080108610861080108010FFF0]
  304. [0C0CFFF0801080D080D08010861086108010B010B0108010FFF0]
  305. [0C0CFFF08010B0D0B0D08010801080108010B0D0B0D08010FFF0]
  306. [0C0CFFF08010999099908010861086108010999099908010FFF0]
  307. [0C0CFFF08010999099908010999099908010999099908010FFF0]
  308.  
  309. " 1's"->Str9
  310. " 2's"->Str9A
  311. " 3's"->Str9B
  312. " 4's"->Str9C
  313. " 5's"->Str9D
  314. " 6's"->Str9E
  315. "3 of a kind"->Str9F
  316. "4 of a kind"->Str9G
  317. " Full House"->Str9H
  318. "Sm Straight"->Str9I
  319. "Lg Straight"->Str9J
  320. " Chance"->Str9K
  321. " Yahtzee"->Str9L
  322. "****************"->Str1
  323. "appvYatzSav"->Str0A
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement