home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1985 February / 1985-02.d64 / cypher_64 (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  151 lines

  1. 70 print"[147]":poke53280,6:poke53281,12
  2. 80 gosub1210
  3. 90 print:print"[147]instructions ?  y/n[146]"
  4. 100 geta$:ifa$=""then100
  5. 110 ifa$="y"thengoto1060
  6. 120 ifa$<>"n"then100
  7. 130 print"[147]":dima(5),z(5),s(5),rc(8),gc(8)
  8. 140 gloc=1039:cgloc=55311:ans=1024:a$="":poke54296,15
  9. 150 hf=54273:lf=54272:hp=54275:lp=54274:ad=54277:sr=54278:wf=54276
  10. 160 cans=55296:sloc=1053:x=0
  11. 170 poke649,1
  12. 180 fork=1to12
  13. 190 fori=1to6
  14. 200 pokegloc,81:pokecgloc,11
  15. 210 gloc=gloc+2:cgloc=cgloc+2
  16. 220 nexti
  17. 230 gloc=gloc+68:cgloc=cgloc+68
  18. 240 nextk
  19. 250 gloc=1039:cgloc=55311
  20. 260 forl=0to5
  21. 270 b=int(rnd(1)*8)
  22. 280 rc(b)=rc(b)+1
  23. 290 a(l)=b
  24. 300 pokeans,90:pokecans,2:gosub1510:ans=ans+2:cans=cans+2
  25. 310 nextl
  26. 320 ans=1024:cans=55296
  27. 330 fori=0to5
  28. 340 getz$:ifz$=""then340
  29. 350 ifasc(z$)=20thengoto1020
  30. 360 ifasc(z$)<49orasc(z$)>57then340
  31. 370 z(i)=val(z$)
  32. 380 z(i)=z(i)-1
  33. 390 ifz(i)=8then800
  34. 400 gc(z(i))=gc(z(i))+1
  35. 410 pokecgloc,z(i)
  36. 420 gosub1330
  37. 430 cgloc=cgloc+2
  38. 440 nexti
  39. 450 fori=0to7
  40. 460 ifgc(i)<=rc(i)thenq=q+gc(i)
  41. 470 ifgc(i)>rc(i)thenq=q+rc(i)
  42. 480 nexti
  43. 490 fork=0to5
  44. 500 ifz(k)=a(k)thenf=f+1
  45. 510 nextk
  46. 520 ifq=0then610
  47. 530 iff=0then580
  48. 540 fork=0tof-1
  49. 550 s(k)=91
  50. 560 nextk
  51. 570 iff=qthen610
  52. 580 fork=ftoq-1
  53. 590 s(k)=87
  54. 600 nextk
  55. 610 fork=0to5
  56. 620 pokesloc,s(k)
  57. 630 pokesloc+54272,0
  58. 640 sloc=sloc+2
  59. 650 nextk
  60. 660 sloc=sloc+68
  61. 670 cgloc=cgloc+68
  62. 680 i=0
  63. 690 x=x+1
  64. 700 iff=6then800
  65. 710 ifx=12goto800
  66. 720 fork=0to5
  67. 730 s(k)=0
  68. 740 nextk
  69. 750 q=0:f=0
  70. 760 fork=0to7
  71. 770 gc(k)=0
  72. 780 nextk
  73. 790 goto330
  74. 800 fort=0to5
  75. 810 pokeans,81
  76. 820 pokecans,a(t)
  77. 830 gosub1420
  78. 840 ans=ans+2:cans=cans+2
  79. 850 next
  80. 860 ifz(i)=8or(x=12andf<6)goto910
  81. 870 print"":print"":print""
  82. 880 print"[144] you won!!":print"[144] moves:"x
  83. 890 goto920
  84. 910 print"[144] you lose!!"
  85. 920 print:print
  86. 930 print" press any key"
  87. 940 getc$:ifc$=""then940
  88. 960 print"[147]  would you like to try again ?  y/n[146]"
  89. 970 geta$
  90. 980 ifa$=""then970
  91. 990 ifa$="y"thenrun90
  92. 1000 ifa$<>"n"then970
  93. 1009 print"[147]":poke54296,0
  94. 1010 poke53280,14:poke53281,6:print"[154]":poke649,10:end
  95. 1020 forde=i*2to1step-1:pokecgloc-de,12:gosub1510:nextde
  96. 1030 forre=0to8:gc(re)=0:nextre
  97. 1040 cgloc=cgloc-(i*2)
  98. 1050 goto330
  99. 1060 print"[147]this is a code breaking game. six of  "
  100. 1065 print"eight random colors will be chosen."
  101. 1070 print"a color may be chosen more than ";
  102. 1075 print"once.   after the six diamonds[160]covering the"
  103. 1080 print"code appear, enter your guess with the  color keys."
  104. 1090 print"after your six colors are entered your  score will appear."
  105. 1100 print"":print"scoring is:"
  106. 1110 print"+=correct color correct location"
  107. 1120 print"0=correct color wrong location"
  108. 1130 print"@=wrong color":print""
  109. 1140 print"the scoring marker locations don't"
  110. 1145 print"relate to the guess locations."
  111. 1150 print"":print"you have 12 turns, if you wish to see "
  112. 1160 print"the code and quit that game enter 9.":print""
  113. 1170 print"if 5 or less colors have been guessed"
  114. 1175 print"enter 'del' to remove the guess."
  115. 1180 print"[144]press any key[146]"
  116. 1190 getr$:ifr$=""then1190
  117. 1200 goto130
  118. 1210 print"[147]   [146]  [146]  [146]    [146]  [146]  [146]    [146]    [146]"
  119. 1220 printspc(9)" [146]      [146]  [146]  [146]  [146][185] [146]  [146][185][185]  [146]  [146]"
  120. 1230 printtab(9)" [146]     [146]    [146]   [185] [146]  [185][185][146]    [223][146]"
  121. 1240 ford=1to9:print" ";:nextd
  122. 1250 print"   [146]   [146]    [146]   [146]  [146]    [146]  [146]   [146]"
  123. 1310 ford=1to2000:next
  124. 1320 return
  125. 1330 ifz(i)=0thenhi=34:lo=75:goto1520
  126. 1340 ifz(i)=1thenhi=38:lo=126:goto1520
  127. 1350 ifz(i)=2thenhi=43:lo=52:goto1520
  128. 1360 ifz(i)=3thenhi=45:lo=198:goto1520
  129. 1370 ifz(i)=4thenhi=51:lo=97:goto1520
  130. 1380 ifz(i)=5thenhi=57:lo=172:goto1520
  131. 1390 ifz(i)=6thenhi=64:lo=188:goto1520
  132. 1400 ifz(i)=7thenhi=68:lo=149:goto1520
  133. 1410 return
  134. 1420 ifa(t)=0thenhi=34:lo=75:goto1520
  135. 1430 ifa(t)=1thenhi=38:lo=126:goto1520
  136. 1440 ifa(t)=2thenhi=43:lo=52:goto1520
  137. 1450 ifa(t)=3thenhi=45:lo=198:goto1520
  138. 1460 ifa(t)=4thenhi=51:lo=97:goto1520
  139. 1470 ifa(t)=5thenhi=57:lo=172:goto1520
  140. 1480 ifa(t)=6thenhi=64:lo=188:goto1520
  141. 1490 ifa(t)=7thenhi=68:lo=149:goto1520
  142. 1500 return
  143. 1510 hi=45:lo=198
  144. 1520 pokehf,hi:pokelf,lo
  145. 1530 pokehp,0:pokelp,255
  146. 1540 pokead,9:pokesr,0
  147. 1550 pokewf,65
  148. 1560 forso=1to150:nextso
  149. 1570 pokewf,64
  150. 1580 return
  151.