home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1985 February
/
1985-02.d64
/
cypher_64
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
151 lines
70 print"[147]":poke53280,6:poke53281,12
80 gosub1210
90 print:print"[147]instructions ? y/n[146]"
100 geta$:ifa$=""then100
110 ifa$="y"thengoto1060
120 ifa$<>"n"then100
130 print"[147]":dima(5),z(5),s(5),rc(8),gc(8)
140 gloc=1039:cgloc=55311:ans=1024:a$="":poke54296,15
150 hf=54273:lf=54272:hp=54275:lp=54274:ad=54277:sr=54278:wf=54276
160 cans=55296:sloc=1053:x=0
170 poke649,1
180 fork=1to12
190 fori=1to6
200 pokegloc,81:pokecgloc,11
210 gloc=gloc+2:cgloc=cgloc+2
220 nexti
230 gloc=gloc+68:cgloc=cgloc+68
240 nextk
250 gloc=1039:cgloc=55311
260 forl=0to5
270 b=int(rnd(1)*8)
280 rc(b)=rc(b)+1
290 a(l)=b
300 pokeans,90:pokecans,2:gosub1510:ans=ans+2:cans=cans+2
310 nextl
320 ans=1024:cans=55296
330 fori=0to5
340 getz$:ifz$=""then340
350 ifasc(z$)=20thengoto1020
360 ifasc(z$)<49orasc(z$)>57then340
370 z(i)=val(z$)
380 z(i)=z(i)-1
390 ifz(i)=8then800
400 gc(z(i))=gc(z(i))+1
410 pokecgloc,z(i)
420 gosub1330
430 cgloc=cgloc+2
440 nexti
450 fori=0to7
460 ifgc(i)<=rc(i)thenq=q+gc(i)
470 ifgc(i)>rc(i)thenq=q+rc(i)
480 nexti
490 fork=0to5
500 ifz(k)=a(k)thenf=f+1
510 nextk
520 ifq=0then610
530 iff=0then580
540 fork=0tof-1
550 s(k)=91
560 nextk
570 iff=qthen610
580 fork=ftoq-1
590 s(k)=87
600 nextk
610 fork=0to5
620 pokesloc,s(k)
630 pokesloc+54272,0
640 sloc=sloc+2
650 nextk
660 sloc=sloc+68
670 cgloc=cgloc+68
680 i=0
690 x=x+1
700 iff=6then800
710 ifx=12goto800
720 fork=0to5
730 s(k)=0
740 nextk
750 q=0:f=0
760 fork=0to7
770 gc(k)=0
780 nextk
790 goto330
800 fort=0to5
810 pokeans,81
820 pokecans,a(t)
830 gosub1420
840 ans=ans+2:cans=cans+2
850 next
860 ifz(i)=8or(x=12andf<6)goto910
870 print"":print"":print""
880 print"[144] you won!!":print"[144] moves:"x
890 goto920
910 print"[144] you lose!!"
920 print:print
930 print" press any key"
940 getc$:ifc$=""then940
960 print"[147] would you like to try again ? y/n[146]"
970 geta$
980 ifa$=""then970
990 ifa$="y"thenrun90
1000 ifa$<>"n"then970
1009 print"[147]":poke54296,0
1010 poke53280,14:poke53281,6:print"[154]":poke649,10:end
1020 forde=i*2to1step-1:pokecgloc-de,12:gosub1510:nextde
1030 forre=0to8:gc(re)=0:nextre
1040 cgloc=cgloc-(i*2)
1050 goto330
1060 print"[147]this is a code breaking game. six of "
1065 print"eight random colors will be chosen."
1070 print"a color may be chosen more than ";
1075 print"once. after the six diamonds[160]covering the"
1080 print"code appear, enter your guess with the color keys."
1090 print"after your six colors are entered your score will appear."
1100 print"":print"scoring is:"
1110 print"+=correct color correct location"
1120 print"0=correct color wrong location"
1130 print"@=wrong color":print""
1140 print"the scoring marker locations don't"
1145 print"relate to the guess locations."
1150 print"":print"you have 12 turns, if you wish to see "
1160 print"the code and quit that game enter 9.":print""
1170 print"if 5 or less colors have been guessed"
1175 print"enter 'del' to remove the guess."
1180 print"[144]press any key[146]"
1190 getr$:ifr$=""then1190
1200 goto130
1210 print"[147] [146] [146] [146] [146] [146] [146] [146] [146]"
1220 printspc(9)" [146] [146] [146] [146] [146][185] [146] [146][185][185] [146] [146]"
1230 printtab(9)" [146] [146] [146] [185] [146] [185][185][146] [223][146]"
1240 ford=1to9:print" ";:nextd
1250 print" [146] [146] [146] [146] [146] [146] [146] [146]"
1310 ford=1to2000:next
1320 return
1330 ifz(i)=0thenhi=34:lo=75:goto1520
1340 ifz(i)=1thenhi=38:lo=126:goto1520
1350 ifz(i)=2thenhi=43:lo=52:goto1520
1360 ifz(i)=3thenhi=45:lo=198:goto1520
1370 ifz(i)=4thenhi=51:lo=97:goto1520
1380 ifz(i)=5thenhi=57:lo=172:goto1520
1390 ifz(i)=6thenhi=64:lo=188:goto1520
1400 ifz(i)=7thenhi=68:lo=149:goto1520
1410 return
1420 ifa(t)=0thenhi=34:lo=75:goto1520
1430 ifa(t)=1thenhi=38:lo=126:goto1520
1440 ifa(t)=2thenhi=43:lo=52:goto1520
1450 ifa(t)=3thenhi=45:lo=198:goto1520
1460 ifa(t)=4thenhi=51:lo=97:goto1520
1470 ifa(t)=5thenhi=57:lo=172:goto1520
1480 ifa(t)=6thenhi=64:lo=188:goto1520
1490 ifa(t)=7thenhi=68:lo=149:goto1520
1500 return
1510 hi=45:lo=198
1520 pokehf,hi:pokelf,lo
1530 pokehp,0:pokelp,255
1540 pokead,9:pokesr,0
1550 pokewf,65
1560 forso=1to150:nextso
1570 pokewf,64
1580 return