home *** CD-ROM | disk | FTP | other *** search
/ Commodore 64 Scene Diskmags Assortment / Uptime_The_Disk_Monthly_V1_07_19xx_Uptime_staff_Side_A.d64 / mastermind (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  3KB  |  97 lines

  1. 1 rem mastermind
  2. 2 rem programming by don sieber
  3. 3 rem published by uptime
  4. 4 :
  5. 10 poke53280,3:poke53281,3:print"[147]"chr$(8)chr$(14)
  6. 15 printtab(9)"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  7. 20 printtab(9)" [205] [193] [211] [212] [197] [210] [205] [201] [206] [196] "
  8. 30 printspc(7)"[164][144]                  [164][154][146]
  9. 40 [153][166]7)"right$stopwaitnstructions       (NULL)stopwaitp(NULL)ime
  10. 42 printtab(12)"[210][197][212][213][210][206] for game"
  11. 45 printspc(5)"[195]64 [208]rogramming by [196]on [211]ieber"
  12. 50 print" [208]ublished by [214]iking [212]echnologies, [201]nc.";
  13. 55 poke 198,0
  14. 60 geta$:ifa$=""then60
  15. 70 ifa$="i"then640
  16. 80 ifa$="u"thensys(8*4096)+4
  17. 85 if a$<>chr$(13) then60
  18. 90 print"[147]";:poke53281,0:print"[158]"
  19. 100 printtab(9)"                     "
  20. 110 printtab(9)" [205] [193] [211] [212] [197] [210] [205] [201] [206] [196] "
  21. 120 printtab(9)"                     "
  22. 130 forn=1to25:t=int(rnd(0)*16+1)
  23. 140 poke53280,t/2:fore=1to50:next:next
  24. 150 print"[147]":poke53281,0
  25. 160 forn=1to5
  26. 170 x(n)=int(rnd(0)*5+3)
  27. 180 next:poke53280,0
  28. 190 forn=1to21:printchr$(17);:next
  29. 195 print"[158]---------------------------------------"
  30. 200 printchr$(18);chr$(28);"    ";chr$(159);"    ";chr$(156);"    ";
  31. 210 print"";chr$(30);"    ";chr$(31);"    ";
  32. 220 printchr$(5);"     ";
  33. 230 w=0:forq=1to5:y(q)=8:nextq
  34. 235 poke 198,0
  35. 240 forj=1to5
  36. 250 getk$:ifk$=""then250
  37. 255 if k$=chr$(140) then sys(8*4096)+4
  38. 260 ifval(k$)<3orval(k$)>7then250
  39. 270 ifk$="3"thend=28:y(j)=3
  40. 280 ifk$="4"thend=159:y(j)=4
  41. 290 ifk$="5"thend=156:y(j)=5
  42. 300 ifk$="6"thend=30:y(j)=6
  43. 310 ifk$="7"thend=31:y(j)=7
  44. 320 printchr$(18);chr$(d);"    ";
  45. 330 nextj
  46. 340 print"[157]";
  47. 350 fort=1to5:p(t)=x(t):next
  48. 360 forn=1to5
  49. 370 ify(n)=p(n)thenprintchr$(18);chr$(5);" ";
  50. 380 ify(n)=p(n)theny(n)=8:p(n)=9:w=w+1
  51. 390 nextn
  52. 400 forn=1to5
  53. 410 ify(n)<8andy(n)=p(1)theny(n)=8:p(1)=9:gosub500
  54. 420 ify(n)<8andy(n)=p(2)theny(n)=8:p(2)=9:gosub500
  55. 430 ify(n)<8andy(n)=p(3)theny(n)=8:p(3)=9:gosub500
  56. 440 ify(n)<8andy(n)=p(4)theny(n)=8:p(4)=9:gosub500
  57. 450 ify(n)<8andy(n)=p(5)theny(n)=8:p(5)=9:gosub500
  58. 460 nextn
  59. 470 ifw=5then530
  60. 480 r=r+1:ifr=10then520
  61. 490 print:print:goto230
  62. 500 printchr$(18);chr$(158);" ";
  63. 510 return
  64. 520 print:poke53280,11:print"[211]orry.....[208]ress [210][197][212][213][210][206]":goto540
  65. 530 print:poke53280,11:print"[195]ongradulations!-[208]ress [210][197][212][213][210][206]"
  66. 540 poke198,0:print"";
  67. 550 forn=1to5:print"";
  68. 560 ifx(n)=3thenprintchr$(28);"    ";
  69. 570 ifx(n)=4thenprintchr$(159);"    ";
  70. 580 ifx(n)=5thenprintchr$(156);"    ";
  71. 590 ifx(n)=6thenprintchr$(30);"    ";
  72. 600 ifx(n)=7thenprintchr$(31);"    ";
  73. 610 next
  74. 620 getk$:ifk$<>chr$(13)then620
  75. 630 run
  76. 640 poke53281,11:print"[147]          *** [201][206][211][212][210][213][195][212][201][207][206][211] ***[155]"
  77. 650 print"  [212]here are 5 colors used in this"
  78. 660 print"  game--red,cyan,purple,green,and blue."
  79. 670 print"  [212]he keys marked with these colors"
  80. 680 print"  will print a colored block on the"
  81. 690 print"  screen. [193]fter you have selected 5"
  82. 700 print"  of any of these colors in a row,the"
  83. 710 print"  computer will print its response."
  84. 720 print"  [206]o print means no correct colors"
  85. 730 print"  were entered. [217]ellow blocks mean"
  86. 740 print"  that number of colors are correct,"
  87. 750 print"  but in the wrong place. [204]ittle white"
  88. 760 print"  blocks mean your colors are correct"
  89. 770 print"  and in the right place.
  90. 780 [153]"  atnfter 10 tries, the computer will"
  91. 790 [153]"  print its secret color code."
  92. 800 [153]"print        (NULL)ress '(NULL)val(NULL)(NULL)(NULL)(NULL)' to begin"
  93. 805 [153]"print         (NULL)ress 'asc8' for (NULL)p(NULL)ime"
  94. 810 [161]a$:[139]a$[178]""[167]810
  95. 820 [139]a$[179][177][199](13)[167]810
  96. 830 [138]90
  97.