home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 224 / 224.d81 / states (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  194 lines

  1. 10 rem     states
  2. 11 rem  by dennis hildreth
  3. 20 fora=24576to25575:pokea,16:next
  4. 25 poke56,32:clr
  5. 30 dv=peek(186):ifdv<8thendv=8
  6. 35 dimsc(2)
  7. 40 sys57812"states data",dv,0:poke780,0:poke781,0:poke782,132:sys65493
  8. 41 sys57812"f.states",dv,0:poke780,0:poke781,0:poke782,56:sys65493
  9. 42 sys57812"f.scores",dv,0:poke780,0:poke781,0:poke782,48:sys65493
  10. 43 sys57812"f.winner",dv,0:poke780,0:poke781,0:poke782,40:sys65493
  11. 44 sys57812"f.options",dv,0:poke780,0:poke781,0:poke782,32:sys65493
  12. 45 sys57812"states ml",dv,0:poke780,0:poke781,0:poke782,192:sys65493
  13. 50 poke53280,0:poke53281,0
  14. 55 poke646,15
  15. 60 eh$="[197]asy":pl$="[212]wo\[208]layers":kb$="[212]wo\[202]oysticks"
  16. 65 poke54286,255:poke54287,255:poke54290,128
  17. 66 poke657,128:poke53247,0:poke53246,0
  18. 70 poke56578,peek(56578)or3
  19. 80 sys49152
  20. 100 gosub200
  21. 105 print"[147]":sys51565:poke657,0
  22. 110 poke56,160:goto40000
  23. 195 :
  24. 196 : main routine
  25. 197 :
  26. 200 poke53272,31:poke53281,0:print"[147]":sys49174
  27. 201 poke781,12:poke782,11:poke783,0:sys65520
  28. 205 print"\\\\\\\\\\\\\\\\\\"
  29. 210 poke781,13:poke782,11:poke783,0:sys65520
  30. 215 print"\[198]1)\[206]ew\[199]ame\\\\\"
  31. 220 poke781,14:poke782,11:poke783,0:sys65520
  32. 225 print"\[198]3)\[207]ptions\\\\\\"
  33. 230 poke781,15:poke782,11:poke783,0:sys65520
  34. 235 print"\[198]5)\[201]nstructions\"
  35. 240 poke781,16:poke782,11:poke783,0:sys65520
  36. 245 print"\[198]7)\[197]xit\\\\\\\\\"
  37. 250 poke781,17:poke782,11:poke783,0:sys65520
  38. 255 print"\\\\\\\\\\\\\\\\\\"
  39. 260 geta$:ifa$=""then260
  40. 270 ifa$=chr$(133)thengosub3000:goto200
  41. 280 ifa$=chr$(134)thengosub500:goto200
  42. 290 ifa$=chr$(135)thengosub1000:goto200
  43. 300 ifa$<>chr$(136)then260
  44. 400 print"[147]":poke53272,25
  45. 410 poke781,12:poke782,15:poke783,0:sys65520
  46. 420 print"[209]uit?\([217]/[206])"
  47. 430 geta$:ifa$=""then430
  48. 435 ifa$="n"then200
  49. 440 ifa$<>"y"then430
  50. 460 return
  51. 495 :
  52. 496 : options
  53. 497 :
  54. 500 poke53272,25:print"[147]":sys49174
  55. 501 poke781,12:poke782,11:poke783,0:sys65520
  56. 505 print"\\\\\\\\\\\\\\\\\\\"
  57. 510 poke781,13:poke782,11:poke783,0:sys65520
  58. 515 print"\[198]1)\"eh$"\[199]ame\\\\\"
  59. 520 poke781,14:poke782,11:poke783,0:sys65520
  60. 525 print"\[198]3)\"pl$"\\\"
  61. 530 poke781,15:poke782,11:poke783,0:sys65520
  62. 535 print"\[198]5)\"kb$"\"
  63. 540 poke781,16:poke782,11:poke783,0:sys65520
  64. 545 print"\[198]7)\[197]xit\[207]ptions\\"
  65. 550 poke781,17:poke782,11:poke783,0:sys65520
  66. 555 print"\\\\\\\\\\\\\\\\\\\"
  67. 560 geta$:ifa$=""then560
  68. 570 ifa$=chr$(133)thengosub2000:goto510
  69. 580 ifa$=chr$(134)thengosub2100:goto520
  70. 590 ifa$=chr$(135)thengosub2200:goto530
  71. 600 ifa$<>chr$(136)then560
  72. 700 return
  73. 995 :
  74. 996 : instructions
  75. 997 :
  76. 1000 sys51565
  77. 1001 ef=0:f$="reader 4000":gosub7000
  78. 1005 print"[147]":poke53281,2:poke53272,23
  79. 1010 ifef=1thengosub8000:goto1990
  80. 1050 sys57812"reader 4000",dv,0:poke780,0:poke781,0:poke782,64:sys65493
  81. 1200 f$="states help":gosub7000
  82. 1210 ifef=1thengosub8000:goto1990
  83. 1500 sys16384,"states help",dv,25600,1,6,"[211] [212] [193] [212] [197] [211]"
  84. 1600 poke53281,0:poke646,15
  85. 1990 return
  86. 1995 :
  87. 1996 : easy/hard game
  88. 1997 :
  89. 2000 ifeh=0theneh=2:eh$="[200]ard":goto2090
  90. 2010 eh=0:eh$="[197]asy"
  91. 2090 return
  92. 2095 :
  93. 2096 : 1 - 2 players
  94. 2097 :
  95. 2100 ifpl=1thenpl=0:poke53246,0:pl$="[212]wo\[208]layers":goto2190
  96. 2110 pl=1:pl$="[207]ne\[208]layer\":poke53246,1
  97. 2190 return
  98. 2195 :
  99. 2196 : 1 - 2 joysticks
  100. 2197 :
  101. 2200 ifkb=1thenkb=0:poke53247,0:kb$="[212]wo\[202]oysticks":goto2290
  102. 2210 kb=1:kb$="[207]ne\[202]oystick\":poke53247,1
  103. 2290 return
  104. 2995 :
  105. 2996 : new game
  106. 2997 :
  107. 3000 sc(1)=0:sc(2)=0
  108. 3010 gosub4000
  109. 3025 print"[198]1) [146][211]tart [146][199]ame             [146][198]2) [146][195]ancel"
  110. 3030 geta$:ifa$=""then3030
  111. 3035 ifa$=chr$(133)thengosub5000:goto3100
  112. 3040 ifa$=chr$(137)then3990
  113. 3050 goto3030
  114. 3100 ifsc(wn)=10then3130
  115. 3105 gosub4000
  116. 3110 print"[198]1) [146][206]ext [146][210]ound             [146][198]2) [146][195]ancel"
  117. 3120 goto3030
  118. 3130 poke53272,27:print"[147]":sys49174
  119. 3150 ifwn=1thench=5:goto3160
  120. 3155 ch=1
  121. 3160 gosub6000
  122. 3190 geta$:ifa$<>chr$(133)then3190
  123. 3990 return
  124. 3995 :
  125. 3996 : scores screen
  126. 3997 :
  127. 4000 poke53272,29:print"[147]":sys49174
  128. 4050 poke781,11:poke782,11:poke783,0:sys65520
  129. 4110 poke781,12:poke782,13:poke783,0:sys65520
  130. 4115 print"\[208]layer\1\"
  131. 4120 poke781,13:poke782,16:poke783,0:sys65520
  132. 4125 printsc(1)
  133. 4130 poke781,15:poke782,13:poke783,0:sys65520
  134. 4135 print"\[208]layer\2\"
  135. 4140 poke781,16:poke782,16:poke783,0:sys65520
  136. 4145 printsc(2)
  137. 4150 poke781,23:poke782,2:poke783,0:sys65520
  138. 4990 return
  139. 4995 :
  140. 4996 : play game
  141. 4997 :
  142. 5000 sz=int(rnd(0)*3):sn=int(rnd(0)*48)
  143. 5010 poke781,sz:poke780,sn:sys49328
  144. 5020 g=int(rnd(0)*eh)
  145. 5030 ong+1goto5080,5035,5040,5050
  146. 5035 sys50299:goto5080
  147. 5040 sys50131:goto5080
  148. 5050 sys50299:sys50131
  149. 5080 sys50456
  150. 5100 wn=peek(780)
  151. 5110 sc(wn)=sc(wn)+1
  152. 5500 poke53265,peek(53265)and223
  153. 5510 poke56576,(peek(56576)and252)or3
  154. 5520 poke53272,20
  155. 5990 return
  156. 5995 :
  157. 5996 : print player
  158. 5997 :
  159. 6000 poke780,ch
  160. 6010 sys51360
  161. 6100 return
  162. 6990 :
  163. 6991 : error checking
  164. 6992 :
  165. 7000 open15,dv,15:close15
  166. 7010 ifst=-128thener$="drive not on":ef=1:goto7900
  167. 7020 open15,dv,15,"r:"+f$+"="+f$:input#15,er,er$,s,t:close15
  168. 7030 ifer=63then7900
  169. 7040 ef=1:ifer=62thener$=f$+" not found"
  170. 7900 return
  171. 7995 :
  172. 7996 : print error message
  173. 7997 :
  174. 8000 poke781,12:poke782,12:poke783,0:sys65520
  175. 8010 printer$
  176. 8050 poke781,24:poke782,2:poke783,0:sys65520
  177. 8060 print"[198]1) [195]ontinue                         "
  178. 8100 geta$:ifa$=""then8100
  179. 8110 ifa$<>chr$(133)then8100
  180. 8200 return
  181. 9995 :
  182. 9996 : end program
  183. 9997 :
  184. 40000 fori=8to29:poke820+i,i:next:ifdv>8anddv<30thenpoke828,dv:poke820+dv,8
  185. 40010 a$="presenter":gosub40030:a$="hello connect":gosub40030
  186. 40020 print"[147]":poke53272,23:poke186,8:poke2048,0:poke44,8:poke43,1:end
  187. 40030 forj=8to29:i=peek(820+j):ifi=14thennext
  188. 40040 close2:open2,i,2:close2:ifstthen40060
  189. 40050 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then40070
  190. 40060 next:return
  191. 40070 a$="hello connect":q$=chr$(34):poke646,peek(53281):print"[147]":poke53272,23
  192. 40080 print"[147]p[207]2048,0:p[207]44,8:p[207]43,1:p[207]56,160:p[207]55,0:clr:l[207]"q$a$q$","i
  193. 40090 print"run:":poke631,13:poke632,13:poke198,2:end
  194.