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