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

  1. 90 poke36879,232:gosub1210:print:print"[147][144]   instructions  y/n  [146]"
  2. 100 geta$:ifa$=""then100
  3. 110 ifa$="y"thengoto1060
  4. 120 ifa$<>"n"then100
  5. 130 print"[147]":dima%(5),z%(5),s%(5),rc%(8),gc%(8)
  6. 140 gloc=7688:cgloc=38408:ans=7680:a$="":poke36878,15
  7. 150 hf=36876:lf=36875
  8. 160 cans=38400:sloc=7695:x=0:fork=1to12:fori=1to6
  9. 210 pokegloc,81:pokecgloc,1:gloc=gloc+1:cgloc=cgloc+1:nexti
  10. 230 gloc=gloc+38:cgloc=cgloc+38:nextk:gloc=7688:cgloc=38408
  11. 260 forl=0to5:b=int(rnd(1)*8):rc%(b)=rc%(b)+1:a%(l)=b
  12. 300 pokeans,90:pokecans,2:gosub1510:ans=ans+1:cans=cans+1:nextl
  13. 320 ans=7680:cans=38400
  14. 330 fori=0to5
  15. 340 getz$:ifz$=""then340
  16. 350 ifasc(z$)=20thengoto1020
  17. 360 ifasc(z$)<49orasc(z$)>57then340
  18. 370 z%(i)=val(z$):z%(i)=z%(i)-1
  19. 390 ifz%(i)=8then800
  20. 400 gc%(z%(i))=gc%(z%(i))+1
  21. 410 pokecgloc,z%(i):gosub1330:cgloc=cgloc+1:next:fori=0to7
  22. 460 ifgc%(i)<=rc%(i)thenq=q+gc%(i)
  23. 470 ifgc%(i)>rc%(i)thenq=q+rc%(i)
  24. 480 nexti:fork=0to5
  25. 500 ifz%(k)=a%(k)thenf=f+1
  26. 520 nextk:ifq=0then620
  27. 530 iff=0then580
  28. 540 fork=0tof-1
  29. 550 s%(k)=91:nextk
  30. 570 iff=qthen620
  31. 580 fork=ftoq-1
  32. 590 s%(k)=87:nextk
  33. 620 fork=0to5:pokesloc,s%(k):pokesloc+30720,0
  34. 640 sloc=sloc+1
  35. 650 nextk
  36. 660 sloc=sloc+38
  37. 670 cgloc=cgloc+38
  38. 680 i=0
  39. 690 x=x+1
  40. 700 iff=6then800
  41. 710 ifx=12goto800
  42. 720 fork=0to5
  43. 730 s%(k)=0
  44. 740 nextk
  45. 750 q=0:f=0
  46. 760 fork=0to7
  47. 770 gc%(k)=0
  48. 780 nextk
  49. 790 goto330
  50. 800 fort=0to5
  51. 810 pokeans,81
  52. 820 pokecans,a%(t)
  53. 830 gosub1420
  54. 840 ans=ans+1:cans=cans+1
  55. 850 nextt
  56. 860 poke198,0:ifz%(i)=8or(x=12andf<6)goto910
  57. 880 print"[147]  you won in"x"moves":print"        ";
  58. 890 goto930
  59. 910 print"[144]you lose"
  60. 930 print" press[157][157][157][157]any[157][157][157]key"
  61. 940 getc$:ifc$=""then940
  62. 960 print"[147][144]would you like to try again ?  y/n[146]"
  63. 980 geta$:ifa$=""then980
  64. 990 ifa$="y"thenrun130
  65. 1000 ifa$<>"n"then980
  66. 1010 print"[147]":end
  67. 1020 forde=ito1step-1:pokecgloc-de,12:gosub1510:nextde
  68. 1030 forre=0to8:gc%(re)=0:nextre
  69. 1040 cgloc=cgloc-(i*1)
  70. 1050 goto330
  71. 1060 print"[147]this is a code break- ing game. six of eightrandom colors will be"
  72. 1070 print"chosen. a color may bechosen more than once.after the six diamonds";
  73. 1080 print"covering the code     appear, enter your    guess with the color  keys."
  74. 1090 print"after your six colors are entered your scorewill appear."
  75. 1092 print"     press any key"
  76. 1095 geta$:ifa$=""then1095
  77. 1100 print"[147]scoring is:"
  78. 1110 print"+=correct color         correct location"
  79. 1120 print"0=correct color wrong   location"
  80. 1130 print"@=wrong color"
  81. 1140 print"the scoring marker    locations don't relateto the guess locations"
  82. 1150 print"you have 12 turns, if you wish to see "
  83. 1160 print"the code and quit thatgame enter '9'."
  84. 1170 print"if 5 or less colors   have been guessed"
  85. 1175 print"enter 'del' to remove the guess."
  86. 1180 print"     press any key[146]"
  87. 1190 getr$:ifr$=""then1190
  88. 1200 goto130
  89. 1210 print"[156][147]  [146]  [146]  [146]    [146]  [146]  [146]    [146]    [146]";
  90. 1220 print" [146]     [146]  [146]  [146]  [146][185] [146]  [146][185][185]  [146]  [146]";
  91. 1230 print" [146]    [146]     [146]  [185] [146]  [185][185][146]   [223][146]";
  92. 1250 print"  [146]   [146]   [146]    [146]  [146]    [146]  [146]  [146]";
  93. 1310 ford=1to2000:nextd
  94. 1320 return
  95. 1330 ifz%(i)=0thenhi=130:lo=130:goto1520
  96. 1340 ifz%(i)=1thenhi=175:lo=175:goto1520
  97. 1350 ifz%(i)=2thenhi=183:lo=183:goto1520
  98. 1360 ifz%(i)=3thenhi=191:lo=191:goto1520
  99. 1370 ifz%(i)=4thenhi=195:lo=195:goto1520
  100. 1380 ifz%(i)=5thenhi=201:lo=201:goto1520
  101. 1390 ifz%(i)=6thenhi=207:lo=207:goto1520
  102. 1400 ifz%(i)=7thenhi=209:lo=209:goto1520
  103. 1410 return
  104. 1420 ifa%(t)=0thenhi=130:lo=130:goto1520
  105. 1430 ifa%(t)=1thenhi=175:lo=175:goto1520
  106. 1440 ifa%(t)=2thenhi=183:lo=183:goto1520
  107. 1450 ifa%(t)=3thenhi=191:lo=191:goto1520
  108. 1460 ifa%(t)=4thenhi=195:lo=195:goto1520
  109. 1470 ifa%(t)=5thenhi=201:lo=201:goto1520
  110. 1480 ifa%(t)=6thenhi=207:lo=207:goto1520
  111. 1490 ifa%(t)=7thenhi=209:lo=209:goto1520
  112. 1500 return
  113. 1510 hi=45:lo=198
  114. 1520 pokehf,hi:pokelf,lo
  115. 1560 forso=1to150:nextso
  116. 1570 pokehf,0:pokelf,0
  117. 1580 return
  118.