home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1985 February
/
1985-02.d64
/
cypher_vic
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
118 lines
90 poke36879,232:gosub1210:print:print"[147][144] 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=7688:cgloc=38408:ans=7680:a$="":poke36878,15
150 hf=36876:lf=36875
160 cans=38400:sloc=7695:x=0:fork=1to12:fori=1to6
210 pokegloc,81:pokecgloc,1:gloc=gloc+1:cgloc=cgloc+1:nexti
230 gloc=gloc+38:cgloc=cgloc+38:nextk:gloc=7688:cgloc=38408
260 forl=0to5:b=int(rnd(1)*8):rc%(b)=rc%(b)+1:a%(l)=b
300 pokeans,90:pokecans,2:gosub1510:ans=ans+1:cans=cans+1:nextl
320 ans=7680:cans=38400
330 fori=0to5
340 getz$:ifz$=""then340
350 ifasc(z$)=20thengoto1020
360 ifasc(z$)<49orasc(z$)>57then340
370 z%(i)=val(z$):z%(i)=z%(i)-1
390 ifz%(i)=8then800
400 gc%(z%(i))=gc%(z%(i))+1
410 pokecgloc,z%(i):gosub1330:cgloc=cgloc+1:next:fori=0to7
460 ifgc%(i)<=rc%(i)thenq=q+gc%(i)
470 ifgc%(i)>rc%(i)thenq=q+rc%(i)
480 nexti:fork=0to5
500 ifz%(k)=a%(k)thenf=f+1
520 nextk:ifq=0then620
530 iff=0then580
540 fork=0tof-1
550 s%(k)=91:nextk
570 iff=qthen620
580 fork=ftoq-1
590 s%(k)=87:nextk
620 fork=0to5:pokesloc,s%(k):pokesloc+30720,0
640 sloc=sloc+1
650 nextk
660 sloc=sloc+38
670 cgloc=cgloc+38
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+1:cans=cans+1
850 nextt
860 poke198,0:ifz%(i)=8or(x=12andf<6)goto910
880 print"[147] you won in"x"moves":print" ";
890 goto930
910 print"[144]you lose"
930 print" press[157][157][157][157]any[157][157][157]key"
940 getc$:ifc$=""then940
960 print"[147][144]would you like to try again ? y/n[146]"
980 geta$:ifa$=""then980
990 ifa$="y"thenrun130
1000 ifa$<>"n"then980
1010 print"[147]":end
1020 forde=ito1step-1:pokecgloc-de,12:gosub1510:nextde
1030 forre=0to8:gc%(re)=0:nextre
1040 cgloc=cgloc-(i*1)
1050 goto330
1060 print"[147]this is a code break- ing game. six of eightrandom colors will be"
1070 print"chosen. a color may bechosen more than once.after the six diamonds";
1080 print"covering the code appear, enter your guess with the color keys."
1090 print"after your six colors are entered your scorewill appear."
1092 print" press any key"
1095 geta$:ifa$=""then1095
1100 print"[147]scoring is:"
1110 print"+=correct color correct location"
1120 print"0=correct color wrong location"
1130 print"@=wrong color"
1140 print"the scoring marker locations don't relateto the guess locations"
1150 print"you have 12 turns, if you wish to see "
1160 print"the code and quit thatgame enter '9'."
1170 print"if 5 or less colors have been guessed"
1175 print"enter 'del' to remove the guess."
1180 print" press any key[146]"
1190 getr$:ifr$=""then1190
1200 goto130
1210 print"[156][147] [146] [146] [146] [146] [146] [146] [146] [146]";
1220 print" [146] [146] [146] [146] [146][185] [146] [146][185][185] [146] [146]";
1230 print" [146] [146] [146] [185] [146] [185][185][146] [223][146]";
1250 print" [146] [146] [146] [146] [146] [146] [146] [146]";
1310 ford=1to2000:nextd
1320 return
1330 ifz%(i)=0thenhi=130:lo=130:goto1520
1340 ifz%(i)=1thenhi=175:lo=175:goto1520
1350 ifz%(i)=2thenhi=183:lo=183:goto1520
1360 ifz%(i)=3thenhi=191:lo=191:goto1520
1370 ifz%(i)=4thenhi=195:lo=195:goto1520
1380 ifz%(i)=5thenhi=201:lo=201:goto1520
1390 ifz%(i)=6thenhi=207:lo=207:goto1520
1400 ifz%(i)=7thenhi=209:lo=209:goto1520
1410 return
1420 ifa%(t)=0thenhi=130:lo=130:goto1520
1430 ifa%(t)=1thenhi=175:lo=175:goto1520
1440 ifa%(t)=2thenhi=183:lo=183:goto1520
1450 ifa%(t)=3thenhi=191:lo=191:goto1520
1460 ifa%(t)=4thenhi=195:lo=195:goto1520
1470 ifa%(t)=5thenhi=201:lo=201:goto1520
1480 ifa%(t)=6thenhi=207:lo=207:goto1520
1490 ifa%(t)=7thenhi=209:lo=209:goto1520
1500 return
1510 hi=45:lo=198
1520 pokehf,hi:pokelf,lo
1560 forso=1to150:nextso
1570 pokehf,0:pokelf,0
1580 return