home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 145
/
145.d81
/
chromo.bas
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
7KB
|
263 lines
10 poke53281,0:poke53280,0:print"[147]":x=rnd(-ti)
20 dime%(4,13),cl$(10),aq%(10),sh%(10)
30 diml%(10),p%(10),n%(10),u%(10),q%(10),m%(10),r%(10),h%(10),o%(10)
40 dv=peek(186):ifdv<8thendv=8
50 gosub60000
60 rem sys57812"chromo sprites",dv,0:poke780,0:poke781,0:poke782,54:sys65493
70 rem sys57812"chromo font",dv,0:poke780,0:poke781,0:poke782,56:sys65493
72 tq=ti
74 ifti<tq+120then74
80 goto700
90 :
100 :rem wiggle
110 :
120 aa%=rnd(0)*12:bb%=11:cc%=-1
140 pokel%(g),64+12*p%(g)+aa%:pokel%(g)+c,g
142 ifvbthen150
144 tq=0
146 tq=tq+1:iftq<20then146
150 ifrnd(0)<zzthenn%(g)=aa%:return
160 aa%=aa%+cc%:ifaa%<0thenaa%=0:goto180
170 goto140
180 pokel%(g),64+12*p%(g)+aa%:pokel%(g)+c,g
182 ifvbthen190
184 tq=0
186 tq=tq+1:iftq<20then186
190 ifrnd(0)<zzthenn%(g)=aa%:return
200 aa%=aa%-cc%
202 ifaa%<0thenaa%=0:goto210
204 ifaa%>11thenaa%=11:goto210
206 goto180
210 cc%=-cc%:goto180
220 :
230 :rem box
240 :
250 poke214,y5:print:poke646,cz
260 printtab(x5)"["left$(tp$,x6)"\"
270 fori=1toy6:printtab(x5)"$"left$(sp$,x6)"%":next
280 printtab(x5)"]"left$(bt$,x6)"^":return
290 :
300 :rem select chromo
310 :
320 co=int(rnd(0)*8)+2:ifex%(co)=0then320
330 ifaq%(co)>rnd(0)*6thenreturn
340 goto320
350 :
360 :rem print scores
370 :
380 poke214,8+g:print:poke646,g
390 printtab(34+(h%(g)>999));:ifh%(g)=0thenprint" ":goto410
400 printh%(g)
410 return
420 :
430 :rem sprite collision?
440 :
450 fori=0togd-1:j=2^i
460 k1=(peek(v+31)andj)
470 ifk1<>jthen490
480 h%(g)=h%(g)+5:gosub380:pokev+21,peek(v+21)and(255-j)
490 next:return
500 :
510 :rem premise
520 :
530 print"[147][129]
540 [161]a$:[139]a$[178]""[167]540
550 [153]"load":[142]
560 :
570 :[143] hi score update
580 :
590 [129]i[178]2[164]9:[139]ex%(i)[178]0[167]610
600 [139]h%(i)[177]h%(i[171]1)[167][139]h%(i)[177]hi[167]hi[178]h%(i):qw[178]i
610 [130]:[142]
620 :
630 :[143] dead
640 :
650 [151]l%(x),60:[151]l%(x)[170]c,x:r%(x)[178]1
660 [142]
670 :
680 :[143] setup
690 :
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
720 [129]i[178]0[164]7:[151]2040[170]i,216[170]i:[130]
730 [151]v[170]21,0:[151]v[170]28,254:[151]v[170]16,0
740 [129]i[178]0[164]63:[151]704[170]i,0:[130]
750 [129]i[178]0[164]7:[151]708[170]3[172]i,255:[151]709[170]3[172]i,255:[130]
760 [129]l[178]0[164]24:[151]c[170]l,0:[130]
770 [129]i[178]0[164]3:[129]j[178]0[164]11:[135]e%(i,j):[130]:[130]
780 [129]i[178]0[164]7:[135]c0%(i),c1%(i),c2%(i):[130]
790 qq$[178]"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
800 sp$[178]"========================================"
810 tp$[178]"________________________________________"
820 bt$[178]"########################################"
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
840 [129]i[178]2[164]9:aq%(i)[178]i:sh%(i)[178]10[171]i:ex%(i)[178]1:[130]
850 [129]i[178]2[164]9:[135]cl$(i):[130]
860 [129]i[178]2[164]9:[135]cn$(i):[130]
870 [129]i[178]2[164]9:[135]t%(i):[130]
880 f%(0)[178]1:f%(1)[178][171]1:f%(2)[178]z:f%(3)[178][171]z
890 [137]1520
900 :
910 :[143] battle
920 :
930 [151]2040,216:[151]v[170]28,255
940 t[178]2:[129]i[178]2[164]9:[139]ex%(i)[178]0[167]980
950 k[178][181]([187](0)[172]8)[170]2:[139]o%(k)[167]950
960 l%(i)[178]t%(k):o%(k)[178]1
970 t[178]t[170]1
980 p%(i)[178][181]([187](0)[172]12)
990 r%(i)[178]0
1000 [130]
1010 [129]j[178]0[164]7
1020 xx[178][181]([187](0)[172]156)[170]50:yy[178][181]([187](0)[172]140)[170]76
1030 [151]v[170]2[172]j,xx:[151]v[170]1[170]2[172]j,yy
1040 [151]vc[170]37,c0%(j):[151]vc[170]38,c1%(j):[151]vc[170]39[170]i,c2%(j):[143] mcm data
1050 [130]
1060 [129]i[178]2[164]9:r%(i)[178]0:[130]
1070 [151]v[170]21,0:ti$[178]"000000"
1080 co[178][181]([187](0)[172]8)[170]2:[139]ex%(co)[178]0[167]1080
1090 [151]214,21:[153]:[153][163]29)"mcont - menu"
1100 :
1110 :[143] loop
1120 :
1130 g[178]co:u%[178]p%(g)
1138 [161]a$
1140 [139]a$[178]"m"[167]1360
1142 [139]a$[178]"t"[167]vb[178]1[171]vb:[151]53280,6[172]vb
1144 [139]a$[179]"1"[176]a$[177]"8"[167]1150
1146 gd[178][197](a$):[151]v[170]21,2[174]gd[171]1
1150 q%(g)[178][181](p%(g)[173]4)
1160 [141]120:[141]450
1170 p%(g)[178]e%(q%(g),n%(g))
1180 m%(g)[178]l%(g)[170]f%([181]((p%(g))[173]4))
1190 [139]ti[177]150[167]x[178]g:[141]650
1200 [139]r%(g)[167]1220
1210 [139][194](m%(g))[179][177]61[167]1270
1220 l%(g)[178]m%(g):h%(g)[178]h%(g)[170]1:[141]380
1230 ti$[178]"000000"
1240 [141]320:[139]ti[177]150[167]x[178]g:[141]650:[137]1360
1250 [139]r%(co)[167]1240
1260 [137]1130
1270 y[178]([194](m%(g)[170]c)[175]15):[139]y[177]9[167]1320
1280 [139]r%(y)[167]1320
1290 [139]y[178]g[167]1320
1300 [139](sh%(g)[171]sh%(y))[179][187](0)[172]6[167]1320:[143] strength
1310 r%(y)[178]1:x[178]y:[141]650:h%(g)[178]h%(g)[170]5:[141]380
1320 p%(g)[178]u%:[137]1130
1330 :
1340 :[143] battle over
1350 :
1360 h%(g)[178]h%(g)[170]10:[141]380:[141]590
1370 [151]214,21:[153]:[153][163]29)"any key ":[151]198,0
1380 [151]214,8[170]qw:[153]
1390 tq[178]ti
1400 [153][163]28)""cn$(qw)"on"
1410 [139]ti[179]tq[170]5[167]1410
1420 [151]646,qw:[153][163]28)cn$(qw)"on"
1430 [139]ti[179]tq[170]10[167]1430
1440 [161]a$:[139]a$[178]""[167]1380
1450 [151]v[170]21,0
1460 cz[178]12:x5[178]1:y5[178]0:x6[178]24:y6[178]21:[141]250
1470 [137]1620
1480 :
1490 :[143] menu
1500 :
1520 [151]53265,11:[153]"loadpoke"[199](142);:[129]i[178]0[164]23:[153]qq$;:[130]
1530 [153][200](qq$,39)"cmdsave@"
1540 [129]i[178]214[164]242:[151]i,[194](i)[176]128:[130]
1550 cz[178]12:x5[178]1:y5[178]0:x6[178]24:y6[178]21:[141]250
1560 cz[178]15:x5[178]27:y5[178]0:x6[178]10:y6[178]5:[141]250
1570 cz[178]1:x5[178]27:y5[178]7:x6[178]10:y6[178]11:[141]250
1580 cz[178]15:x5[178]27:y5[178]20:x6[178]10:y6[178]1:[141]250
1590 [151]214,2:[153]:[153][163]29)"forflippin'
1600 printtab(30)"chromo-"
1610 printtab(31)"somes"
1620 poke214,8:print:printtab(30)"[155]scores"
1630 fori=2to9:poke646,i:printtab(28)cn$(i):next
1640 poke214,2:print:printtab(6)"[154]experiment setup"
1650 printtab(3)"[155]chromosome c s x
1660 [153][163]3)"---------- - - -
1670 fori=2to9:poke646,i:printtab(3)cl$(i)tab(15)aq%(i)tab(19)sh%(i)tab(24);
1680 ifex%(i)thenprint"x":goto1700
1690 print" "
1700 next
1710 poke214,14:print:ifaz=0thenaz=1:goto1760
1720 fori=0to2:printtab(3)left$(sp$,20):next
1730 printtab(3)"[145][145]r[154] - reset scores
1740 [153][163]3)"kcont - keep same scores"
1750 [137]1800
1760 [151]214,14:[153]
1770 [153][163]3)"listc - curiosity
1780 printtab(3)"s - strength
1790 [153][163]3)"x - experiment in/out
1800 printtab(3)"[154]use crsr keys[154]/joystick
1810 [153][163]3)"returncont/firecont - increase
1820 printtab(3)"[154]press x[154] for experiment
1830 [151]214,21:[153]:[153][163]29)"qcont - quit"
1840 [151]2040,11:xm[178]0:ym[178]2:[151]v[170]38,1:[151]v[170]27,1
1850 [151]v,140[170]xm[172]32:[151]v[170]1,89[170]ym[172]8:[151]v[170]21,1
1852 [139]dq[178]0[167]dq[178]1:[151]53272,31:[151]53265,27
1860 [161]a$:[139]a$[179][177]""[167]1870
1862 jy[178][194](56320)
1864 tq[178]ti
1866 [139]ti[179]tq[170]4[167]1866
1870 [139]a$[178]""[176]jy[178]119[167]xm[178]xm[170]1:[139]xm[177]2[167]xm[178]0
1880 [139]a$[178]"cmd"[176]jy[178]123[167]xm[178]xm[171]1:[139]xm[179]0[167]xm[178]2
1890 [139]a$[178]""[176]jy[178]125[167]ym[178]ym[170]1:[139]ym[177]9[167]ym[178]2
1900 [139]a$[178]"on"[176]jy[178]126[167]ym[178]ym[171]1:[139]ym[179]2[167]ym[178]9
1910 [139]a$[178][199](13)[176]jy[179]112[167]1990
1912 [139]a$[178]"q"[167]40000
1920 [139]az[167][139]a$[178]"k"[167]1950
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
1940 [139]a$[179][177]"x"[167]1850
1950 [151]v[170]21,0:[153]"":[129]i[178]1[164]20:[153][163]3)[200](sp$,22):[130]
1960 [129]i[178]2[164]9:o%(i)[178]0:[130]
1970 [137]930
1990 [151]214,4[170]ym:[153]:[151]646,ym
2000 [139]xm[178]2[167]2090
2010 [139]xm[178]1[167]2050
2020 aq%(ym)[178]aq%(ym)[170]1:[139]aq%(ym)[177]9[167]aq%(ym)[178]9
2030 sh%(ym)[178]10[171]aq%(ym)
2040 [137]2060
2050 sh%(ym)[178]sh%(ym)[170]1:[139]sh%(ym)[177]9[167]sh%(ym)[178]9
2060 aq%(ym)[178]10[171]sh%(ym)
2070 [153][163]15)aq%(ym)[163]19)sh%(ym)
2080 [137]1850
2090 [153][163]24);
2100 [139]ex%(ym)[167]ex%(ym)[178]0:[153]" ":[137]1850
2110 ex%(ym