home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 145 / 145.d81 / chromo.bas (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  7KB  |  263 lines

  1. 10 poke53281,0:poke53280,0:print"[147]":x=rnd(-ti)
  2. 20 dime%(4,13),cl$(10),aq%(10),sh%(10)
  3. 30 diml%(10),p%(10),n%(10),u%(10),q%(10),m%(10),r%(10),h%(10),o%(10)
  4. 40 dv=peek(186):ifdv<8thendv=8
  5. 50 gosub60000
  6. 60 rem sys57812"chromo sprites",dv,0:poke780,0:poke781,0:poke782,54:sys65493
  7. 70 rem sys57812"chromo font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
  8. 72 tq=ti
  9. 74 ifti<tq+120then74
  10. 80 goto700
  11. 90 :
  12. 100 :rem wiggle
  13. 110 :
  14. 120 aa%=rnd(0)*12:bb%=11:cc%=-1
  15. 140 pokel%(g),64+12*p%(g)+aa%:pokel%(g)+c,g
  16. 142 ifvbthen150
  17. 144 tq=0
  18. 146 tq=tq+1:iftq<20then146
  19. 150 ifrnd(0)<zzthenn%(g)=aa%:return
  20. 160 aa%=aa%+cc%:ifaa%<0thenaa%=0:goto180
  21. 170 goto140
  22. 180 pokel%(g),64+12*p%(g)+aa%:pokel%(g)+c,g
  23. 182 ifvbthen190
  24. 184 tq=0
  25. 186 tq=tq+1:iftq<20then186
  26. 190 ifrnd(0)<zzthenn%(g)=aa%:return
  27. 200 aa%=aa%-cc%
  28. 202 ifaa%<0thenaa%=0:goto210
  29. 204 ifaa%>11thenaa%=11:goto210
  30. 206 goto180
  31. 210 cc%=-cc%:goto180
  32. 220 :
  33. 230 :rem box
  34. 240 :
  35. 250 poke214,y5:print:poke646,cz
  36. 260 printtab(x5)"["left$(tp$,x6)"\"
  37. 270 fori=1toy6:printtab(x5)"$"left$(sp$,x6)"%":next
  38. 280 printtab(x5)"]"left$(bt$,x6)"^":return
  39. 290 :
  40. 300 :rem select chromo
  41. 310 :
  42. 320 co=int(rnd(0)*8)+2:ifex%(co)=0then320
  43. 330 ifaq%(co)>rnd(0)*6thenreturn
  44. 340 goto320
  45. 350 :
  46. 360 :rem print scores
  47. 370 :
  48. 380 poke214,8+g:print:poke646,g
  49. 390 printtab(34+(h%(g)>999));:ifh%(g)=0thenprint"    ":goto410
  50. 400 printh%(g)
  51. 410 return
  52. 420 :
  53. 430 :rem sprite collision?
  54. 440 :
  55. 450 fori=0togd-1:j=2^i
  56. 460 k1=(peek(v+31)andj)
  57. 470 ifk1<>jthen490
  58. 480 h%(g)=h%(g)+5:gosub380:pokev+21,peek(v+21)and(255-j)
  59. 490 next:return
  60. 500 :
  61. 510 :rem premise
  62. 520 :
  63. 530 print"[147][129]
  64. 540 [161]a$:[139]a$[178]""[167]540
  65. 550 [153]"load":[142]
  66. 560 :
  67. 570 :[143] hi score update
  68. 580 :
  69. 590 [129]i[178]2[164]9:[139]ex%(i)[178]0[167]610
  70. 600 [139]h%(i)[177]h%(i[171]1)[167][139]h%(i)[177]hi[167]hi[178]h%(i):qw[178]i
  71. 610 [130]:[142]
  72. 620 :
  73. 630 :[143] dead
  74. 640 :
  75. 650 [151]l%(x),60:[151]l%(x)[170]c,x:r%(x)[178]1
  76. 660 [142]
  77. 670 :
  78. 680 :[143] setup
  79. 690 :
  80. 700 sc[178]1024:c[178]54272:co[178]1:vc[178]53248:v[178]vc:z[178]40:zz[178].085:vb[178]0
  81. 720 [129]i[178]0[164]7:[151]2040[170]i,216[170]i:[130]
  82. 730 [151]v[170]21,0:[151]v[170]28,254:[151]v[170]16,0
  83. 740 [129]i[178]0[164]63:[151]704[170]i,0:[130]
  84. 750 [129]i[178]0[164]7:[151]708[170]3[172]i,255:[151]709[170]3[172]i,255:[130]
  85. 760 [129]l[178]0[164]24:[151]c[170]l,0:[130]
  86. 770 [129]i[178]0[164]3:[129]j[178]0[164]11:[135]e%(i,j):[130]:[130]
  87. 780 [129]i[178]0[164]7:[135]c0%(i),c1%(i),c2%(i):[130]
  88. 790 qq$[178]"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
  89. 800 sp$[178]"========================================"
  90. 810 tp$[178]"________________________________________"
  91. 820 bt$[178]"########################################"
  92. 830 [129]i[178]2[164]9:aq%(i)[178]5:sh%(i)[178]5:ex%(i)[178]0:[130]:ex%(2)[178]1:ex%(3)[178]1:ex%(4)[178]1
  93. 840 [129]i[178]2[164]9:aq%(i)[178]i:sh%(i)[178]10[171]i:ex%(i)[178]1:[130]
  94. 850 [129]i[178]2[164]9:[135]cl$(i):[130]
  95. 860 [129]i[178]2[164]9:[135]cn$(i):[130]
  96. 870 [129]i[178]2[164]9:[135]t%(i):[130]
  97. 880 f%(0)[178]1:f%(1)[178][171]1:f%(2)[178]z:f%(3)[178][171]z
  98. 890 [137]1520
  99. 900 :
  100. 910 :[143] battle
  101. 920 :
  102. 930 [151]2040,216:[151]v[170]28,255
  103. 940 t[178]2:[129]i[178]2[164]9:[139]ex%(i)[178]0[167]980
  104. 950 k[178][181]([187](0)[172]8)[170]2:[139]o%(k)[167]950
  105. 960 l%(i)[178]t%(k):o%(k)[178]1
  106. 970 t[178]t[170]1
  107. 980 p%(i)[178][181]([187](0)[172]12)
  108. 990 r%(i)[178]0
  109. 1000 [130]
  110. 1010 [129]j[178]0[164]7
  111. 1020 xx[178][181]([187](0)[172]156)[170]50:yy[178][181]([187](0)[172]140)[170]76
  112. 1030 [151]v[170]2[172]j,xx:[151]v[170]1[170]2[172]j,yy
  113. 1040 [151]vc[170]37,c0%(j):[151]vc[170]38,c1%(j):[151]vc[170]39[170]i,c2%(j):[143] mcm data
  114. 1050 [130]
  115. 1060 [129]i[178]2[164]9:r%(i)[178]0:[130]
  116. 1070 [151]v[170]21,0:ti$[178]"000000"
  117. 1080 co[178][181]([187](0)[172]8)[170]2:[139]ex%(co)[178]0[167]1080
  118. 1090 [151]214,21:[153]:[153][163]29)"mcont - menu"
  119. 1100 :
  120. 1110 :[143] loop
  121. 1120 :
  122. 1130 g[178]co:u%[178]p%(g)
  123. 1138 [161]a$
  124. 1140 [139]a$[178]"m"[167]1360
  125. 1142 [139]a$[178]"t"[167]vb[178]1[171]vb:[151]53280,6[172]vb
  126. 1144 [139]a$[179]"1"[176]a$[177]"8"[167]1150
  127. 1146 gd[178][197](a$):[151]v[170]21,2[174]gd[171]1
  128. 1150 q%(g)[178][181](p%(g)[173]4)
  129. 1160 [141]120:[141]450
  130. 1170 p%(g)[178]e%(q%(g),n%(g))
  131. 1180 m%(g)[178]l%(g)[170]f%([181]((p%(g))[173]4))
  132. 1190 [139]ti[177]150[167]x[178]g:[141]650
  133. 1200 [139]r%(g)[167]1220
  134. 1210 [139][194](m%(g))[179][177]61[167]1270
  135. 1220 l%(g)[178]m%(g):h%(g)[178]h%(g)[170]1:[141]380
  136. 1230 ti$[178]"000000"
  137. 1240 [141]320:[139]ti[177]150[167]x[178]g:[141]650:[137]1360
  138. 1250 [139]r%(co)[167]1240
  139. 1260 [137]1130
  140. 1270 y[178]([194](m%(g)[170]c)[175]15):[139]y[177]9[167]1320
  141. 1280 [139]r%(y)[167]1320
  142. 1290 [139]y[178]g[167]1320
  143. 1300 [139](sh%(g)[171]sh%(y))[179][187](0)[172]6[167]1320:[143] strength
  144. 1310 r%(y)[178]1:x[178]y:[141]650:h%(g)[178]h%(g)[170]5:[141]380
  145. 1320 p%(g)[178]u%:[137]1130
  146. 1330 :
  147. 1340 :[143] battle over
  148. 1350 :
  149. 1360 h%(g)[178]h%(g)[170]10:[141]380:[141]590
  150. 1370 [151]214,21:[153]:[153][163]29)"any key ":[151]198,0
  151. 1380 [151]214,8[170]qw:[153]
  152. 1390 tq[178]ti
  153. 1400 [153][163]28)""cn$(qw)"on"
  154. 1410 [139]ti[179]tq[170]5[167]1410
  155. 1420 [151]646,qw:[153][163]28)cn$(qw)"on"
  156. 1430 [139]ti[179]tq[170]10[167]1430
  157. 1440 [161]a$:[139]a$[178]""[167]1380
  158. 1450 [151]v[170]21,0
  159. 1460 cz[178]12:x5[178]1:y5[178]0:x6[178]24:y6[178]21:[141]250
  160. 1470 [137]1620
  161. 1480 :
  162. 1490 :[143] menu
  163. 1500 :
  164. 1520 [151]53265,11:[153]"loadpoke"[199](142);:[129]i[178]0[164]23:[153]qq$;:[130]
  165. 1530 [153][200](qq$,39)"cmdsave@"
  166. 1540 [129]i[178]214[164]242:[151]i,[194](i)[176]128:[130]
  167. 1550 cz[178]12:x5[178]1:y5[178]0:x6[178]24:y6[178]21:[141]250
  168. 1560 cz[178]15:x5[178]27:y5[178]0:x6[178]10:y6[178]5:[141]250
  169. 1570 cz[178]1:x5[178]27:y5[178]7:x6[178]10:y6[178]11:[141]250
  170. 1580 cz[178]15:x5[178]27:y5[178]20:x6[178]10:y6[178]1:[141]250
  171. 1590 [151]214,2:[153]:[153][163]29)"forflippin'
  172. 1600 printtab(30)"chromo-"
  173. 1610 printtab(31)"somes"
  174. 1620 poke214,8:print:printtab(30)"[155]scores"
  175. 1630 fori=2to9:poke646,i:printtab(28)cn$(i):next
  176. 1640 poke214,2:print:printtab(6)"[154]experiment setup"
  177. 1650 printtab(3)"[155]chromosome   c   s   x
  178. 1660 [153][163]3)"----------   -   -   -
  179. 1670 fori=2to9:poke646,i:printtab(3)cl$(i)tab(15)aq%(i)tab(19)sh%(i)tab(24);
  180. 1680 ifex%(i)thenprint"x":goto1700
  181. 1690 print" "
  182. 1700 next
  183. 1710 poke214,14:print:ifaz=0thenaz=1:goto1760
  184. 1720 fori=0to2:printtab(3)left$(sp$,20):next
  185. 1730 printtab(3)"[145][145]r[154] - reset scores
  186. 1740 [153][163]3)"kcont - keep same scores"
  187. 1750 [137]1800
  188. 1760 [151]214,14:[153]
  189. 1770 [153][163]3)"listc - curiosity
  190. 1780 printtab(3)"s - strength
  191. 1790 [153][163]3)"x - experiment in/out
  192. 1800 printtab(3)"[154]use crsr keys[154]/joystick
  193. 1810 [153][163]3)"returncont/firecont - increase
  194. 1820 printtab(3)"[154]press x[154] for experiment
  195. 1830 [151]214,21:[153]:[153][163]29)"qcont - quit"
  196. 1840 [151]2040,11:xm[178]0:ym[178]2:[151]v[170]38,1:[151]v[170]27,1
  197. 1850 [151]v,140[170]xm[172]32:[151]v[170]1,89[170]ym[172]8:[151]v[170]21,1
  198. 1852 [139]dq[178]0[167]dq[178]1:[151]53272,31:[151]53265,27
  199. 1860 [161]a$:[139]a$[179][177]""[167]1870
  200. 1862 jy[178][194](56320)
  201. 1864 tq[178]ti
  202. 1866 [139]ti[179]tq[170]4[167]1866
  203. 1870 [139]a$[178]""[176]jy[178]119[167]xm[178]xm[170]1:[139]xm[177]2[167]xm[178]0
  204. 1880 [139]a$[178]"cmd"[176]jy[178]123[167]xm[178]xm[171]1:[139]xm[179]0[167]xm[178]2
  205. 1890 [139]a$[178]""[176]jy[178]125[167]ym[178]ym[170]1:[139]ym[177]9[167]ym[178]2
  206. 1900 [139]a$[178]"on"[176]jy[178]126[167]ym[178]ym[171]1:[139]ym[179]2[167]ym[178]9
  207. 1910 [139]a$[178][199](13)[176]jy[179]112[167]1990
  208. 1912 [139]a$[178]"q"[167]40000
  209. 1920 [139]az[167][139]a$[178]"k"[167]1950
  210. 1930 [139]az[167][139]a$[178]"r"[167][129]i[178]2[164]9:h%(i)[178]0:g[178]i:[141]380:[130]:[137]1950
  211. 1940 [139]a$[179][177]"x"[167]1850
  212. 1950 [151]v[170]21,0:[153]"":[129]i[178]1[164]20:[153][163]3)[200](sp$,22):[130]
  213. 1960 [129]i[178]2[164]9:o%(i)[178]0:[130]
  214. 1970 [137]930
  215. 1990 [151]214,4[170]ym:[153]:[151]646,ym
  216. 2000 [139]xm[178]2[167]2090
  217. 2010 [139]xm[178]1[167]2050
  218. 2020 aq%(ym)[178]aq%(ym)[170]1:[139]aq%(ym)[177]9[167]aq%(ym)[178]9
  219. 2030 sh%(ym)[178]10[171]aq%(ym)
  220. 2040 [137]2060
  221. 2050 sh%(ym)[178]sh%(ym)[170]1:[139]sh%(ym)[177]9[167]sh%(ym)[178]9
  222. 2060 aq%(ym)[178]10[171]sh%(ym)
  223. 2070 [153][163]15)aq%(ym)[163]19)sh%(ym)
  224. 2080 [137]1850
  225. 2090 [153][163]24);
  226. 2100 [139]ex%(ym)[167]ex%(ym)[178]0:[153]" ":[137]1850
  227. 2110 ex%(ym