8-Bit Software Online Conversion
Match It Game - Listing
10:
20:
30:
40REM" PROGRAM BY RUSHDEN ROY
A 'L PLATE' PROGRAMMER.(JUNE 95)
IDEA TAKEN FROM THE BOOK "ME
AND MY MICRO" PROGRAM MATCHEM.
50:
60:
70MODE7
80ON ERROR GOTO 1900
90*FX210,0
100*FX229,1
110VDU23,1,0;0;0;0
120PROCROY
130PROCdh(6,8,1,"-MATCH THAT NOISE- "
)
140PROCdh(6,10,0,"The object of this g
ame is to open")
150PROCdh(6,11,0,"two boxes at a time
and try to get")
160PROCdh(6,12,0,"matching pairs.")
170PROCdh(6,13,0,"When a box opens you
will hear")
180PROCdh(6,14,0,"a sound and see a le
tter. Or hear ")
190PROCdh(6,15,0,"a sound only. Or see
a letter only.")
200PROCdh(6,17,0,"(This game is based
on the program ")
210PROCdh(6,18,0,"MATCHEM a card game
in the book")
220PROCdh(6,19,0,"'Me and My Micro')")
230PROCdh(2,22,0,"Please press space >
>>)")
240REPEAT UNTIL GET=32
250CLS
260VDU23,1,0;0;0;0;
270PROCdh(2,4,1,"Would you like the ga
me ")
280PROCdh(2,7,0,"fairly easy? (Sound o
nly)........1")
290PROCdh(2,10,0,"easy? (Letters
only)........2")
300PROCdh(2,13,0,"very easy? (Letters
and sound)...3")
310PROCdh(3,16,0,"Please choose 1, 2 o
r 3")
320yes$="N"
330REPEAT
340choice$=GET$
350UNTIL choice$>="1" AND choice$<="3"
360IF choice$="1" THEN yes$="N":*FX210
,0
370IF choice$="2" THEN yes$="Y":*FX210
,1
380IF choice$="3" THEN yes$="Y"
390CLS
400ENVELOPE2,30,6,0,0,255,0,0,126,0,0,
-126,126,126
410ENVELOPE3,3,6,0,1,255,0,0,126,0,0,-
126,126,126
420ENVELOPE5,4,-1,1,0,20,20,0,126,0,0,
-126,126,126
430ENVELOPE6,5,1,20,8,200,0,0,126,0,0,
-126,126,126
440ENVELOPE7,9,19,13,-8,4,4,4,126,0,0,
-126,126,126
450ENVELOPE8,1,18,0,0,2,0,0,126,0,0,-1
26,126,126
460ENVELOPE9,3,0,0,0,0,0,0,-126,-2,0,-
1,126,80
470PROCinit
480REPEAT
490PROCchoosebox
500firstguess=i%:n1=n:m1=m
510PROCshowbox
520REPEAT
530PROCchoosebox
540UNTILi%<>firstguess
550PROCshowbox
560guess=guess+1
570FOR t=1TOdelay:NEXT t
580PROCcheckformatch
590IF match=1 THEN PROCifboxmatch
600IF match=0 THEN PROCifnomatch
610PRINTTAB(1,2)CHR$(134)"Tries= ";gue
ss;" Score= ";score
620UNTILscore=10
630IF score=10 PROCendofgame
640END
650:
660DEF PROCinit
670guess=0:score=0
680a$="AABBCCDDEEFFGGHHIIJJ"
690j$="":delay=2500
700FOR k=1TO20:l=LENa$:n=RND(l)
710j$=j$+MID$(a$,n,1)
720a$=LEFT$(a$,n-1)+RIGHT$(a$,l-n)
730NEXT k
740FOR n=0TO4
750FORm=0TO3
760SP$=" "
770PRINTTAB(8*n+1,5*m+4);CHR$(147);CHR
$(172);CHR$(172);CHR$(164);CHR$(172);CHR
$(172);CHR$(172)
780PRINTTAB(8*n+1,5*m+5);CHR$(131);CHR
$(157);CHR$(129)n+5*m+1;SP$;CHR$(156)
790PRINTTAB(8*n+1,5*m+6);CHR$(131);CHR
$(157);CHR$(131)n+5*m+1;SP$;CHR$(156)
800NEXTm:NEXTn
810PRINTTAB(6,5);CHR$(147);CHR$(255);C
HR$(156)TAB(14,5);CHR$(147);CHR$(255);CH
R$(156)TAB(22,5);CHR$(147);CHR$(255);CHR
$(156)TAB(30,5);CHR$(147);CHR$(255);CHR$
(156)TAB(38,5)CHR$(147);CHR$(255)
820PRINTTAB(7,6);CHR$(255);CHR$(156)TA
B(15,6);CHR$(255);CHR$(156)TAB(23,6);CHR
$(255);CHR$(156)TAB(31,6);CHR$(255);CHR$
(156)TAB(39,6)CHR$(255)
830PRINTTAB(6,10);CHR$(147);CHR$(255);
CHR$(156)TAB(14,10);CHR$(147);CHR$(255);
CHR$(156)TAB(22,10);CHR$(147);CHR$(255);
CHR$(156)TAB(30,10);CHR$(147);CHR$(255);
CHR$(156)
840PRINTTAB(7,11);CHR$(255);CHR$(156)T
AB(15,11);CHR$(255);CHR$(156)TAB(23,11);
CHR$(255);CHR$(156)TAB(31,11);CHR$(255);
CHR$(156)
850ENDPROC
860:
870DEF PROCchoosebox
880PROCdh(5,0,1,"See if you can match
a pair of boxes.")
890PRINTTAB(22,2)CHR$(134);"(To quit t
ype 21)"
900REPEAT
910VDU23,1,1;0;0;0;
920PRINTTAB(0,23);CHR$(134)
930PRINTTAB(17,23);STRING$(20," ")
940INPUTTAB(1,23)"Open box number ?"i%
950IF i% <1 OR i%>21 THEN PRINTTAB(18,
23)SPC(15):VDU7:GOTO940
960IFi%=21 THEN PROCend
970c$=MID$(j$,i%,1)
980IF c$="`"THEN PRINTTAB(18,23)" ":V
DU7
990UNTIL i%>=1AND i%<=20ANDc$<>"`"
1000PRINTTAB(18,23)" "
1010m=INT((i%-1)/5)
1020n=i%-5*m-1
1030ENDPROC
1040:
1050DEF PROCshowbox
1060IF"Y"=yes$THEN y$="A"ELSEy$=" "
1070IFc$="A"THENx$=CHR$(147)+CHR$(184)+
CHR$(161)+y$+" "+CHR$(162)+CHR$(228):SOU
ND0,9,100,1
1080IF"Y"=yes$THEN y$="B"ELSEy$=" "
1090IFc$="B"THENx$=CHR$(147)+CHR$(184)+
CHR$(161)+y$+" "+CHR$(162)+CHR$(228):SOU
ND1,8,170,10:SOUND1,0,0,5:SOUND1,8,170,8
1100IF"Y"=yes$THEN y$="C"ELSEy$=" "
1110IFc$="C"THENx$=CHR$(147)+CHR$(184)+
CHR$(161)+y$+" "+CHR$(162)+CHR$(228) :SO
UND1,7,150,20
1120IF"Y"=yes$THEN y$="D"ELSEy$=" "
1130IFc$="D"THENx$=CHR$(147)+CHR$(184)+
CHR$(161)+y$+" "+CHR$(162)+CHR$(228):FOR
S%=255TO211STEP-4:SOUND1,-15,S%,1:FOR D=
1TO40:NEXT:NEXT
1140IF"Y"=yes$THEN y$="E"ELSEy$=" "
1150IFc$="E"THENx$=CHR$(147)+CHR$(184)+
CHR$(161)+y$+" "+CHR$(162)+CHR$(228):FOR
P=100TO8STEP-10:SOUND1,-15,P,2:NEXT
1160IF"Y"=yes$THEN y$="F"ELSEy$=" "
1170IFc$="F"THENx$=CHR$(147)+CHR$(184)+
CHR$(161)+y$+" "+CHR$(162)+CHR$(228):SOU
ND1,2,4,30
1180IF"Y"=yes$THEN y$="G"ELSEy$=" "
1190IFc$="G"THENx$=CHR$(147)+CHR$(184)+
CHR$(161)+y$+" "+CHR$(162)+CHR$(228):SOU
ND0,3,7,20
1200IF"Y"=yes$THEN y$="H"ELSEy$=" "
1210IFc$="H"THENx$=CHR$(147)+CHR$(184)+
CHR$(161)+y$+" "+CHR$(162)+CHR$(228) :FO
Rc=1TO3:SOUND0,-15,0,7:SOUND0,-12,1,7:NE
XTc
1220IF"Y"=yes$THEN y$="I"ELSEy$=" "
1230IFc$="I"THENx$=CHR$(147)+CHR$(184)+
CHR$(161)+y$+" "+CHR$(162)+CHR$(228):SOU
ND1,5,200,20
1240IF"Y"=yes$THEN y$="J"ELSEy$=" "
1250IFc$="J"THENx$=CHR$(147)+CHR$(184)+
CHR$(161)+y$+" "+CHR$(162)+CHR$(228):SOU
ND0,6,1,20
1260PRINTTAB(8*n+1,5*m+4)x$
1270ENDPROC
1280:
1290DEF PROCcheckformatch
1300match=0
1310IF MID$(j$,firstguess,1)=MID$(j$,i%
,1)THEN match=1
1320ENDPROC
1330:
1340DEF PROCifboxmatch
1350j$=LEFT$(j$,firstguess-1)+"`"+RIGHT
$(j$,LEN j$-firstguess)
1360j$=LEFT$(j$,i%-1)+"`"+RIGHT$(j$,LEN
j$-i%)
1370bl$=" "
1380PRINTTAB(8*n+1,5*m+4);bl$
1390PRINTTAB(8*n1+1,5*m1+4);bl$
1400PRINTTAB(8*n+1,5*m+5);CHR$(146);" )
p& "CHR$(129)
1410PRINTTAB(8*n1+1,5*m1+5);CHR$(146);"
)p& "CHR$(129)
1420PRINTTAB(8*n+1,5*m+6);CHR$(146);" &
) "CHR$(129)
1430PRINTTAB(8*n1+1,5*m1+6);CHR$(146);"
& ) "CHR$(129)
1440score=score+1
1450ENDPROC
1460:
1470DEF PROCifnomatch
1480PRINTTAB(8*n1+1,5*m1+4);CHR$(147);C
HR$(172);CHR$(172);CHR$(164);CHR$(172);C
HR$(172);CHR$(172)
1490PRINTTAB(8*n+1,5*m+4);CHR$(147);CHR
$(172);CHR$(172);CHR$(164);CHR$(172);CHR
$(172);CHR$(172)
1500ENDPROC
1510:
1520DEFPROCROY
1530PRINT
1540PRINT" PROGRAM B
Y ££££££££"
1550PRINT"
k 7e757£k"
1560PRINT"
s550!5u0£5"
1570PRINT"
p5u7t5upp5"
1580PRINT
1590PRINT" FOR 8-BIT SOFTWARE"
1600PRINT" 17 Lambert Park Rd Hedon HUL
L HU12 8HF"'
1610ENDPROC
1620:
1630DEF PROCdh(C%,L%,D%,A$)
1640IF D% A$=CHR$(141)+A$
1650X%=(40-LENA$)DIV 2-1
1660FORY%=L%TOL%+D%:PRINTTAB(X%,Y%);CHR
$(128+C%);A$:NEXT
1670ENDPROC
1680:
1690DEF PROCend
1700CLS
1710PRINTTAB(10,10)"BYE FROM ROY"
1720VDU23,1,1;0;0;0
1730*FX229,0
1740*FX210,0
1750*FX21,0
1760END
1770ENDPROC
1780DEF PROCendofgame
1790CLS
1800w$="WOW!"
1810PRINTTAB(3,3);CHR$(133)CHR$(136);w$
;CHR$(134);w$;CHR$(130);w$;CHR$(131);w$;
CHR$(132);w$;CHR$(129);w$
1820PROCdh(3,5,1,"WELL DONE")
1830PROCdh(3,8,0," YOU HAD")
1840PRINTTAB(18,10);CHR$(131);guess
1850PROCdh(3,12,0," TRIES")
1860PRINTTAB(0,15)CHR$(134)"Would you l
ike another game ? Y/N";
1870ans$=GET$:IF ans$<>"Y"ANDans$<>"N"
THEN GOTO 1870
1880IF ans$="Y" GOTO 250ELSE PROCend
1890ENDPROC
1900ON ERROR OFF:IF ERR=20 THEN RUN ELS
E MODE 7:REPORT:PRINT" at line ";ERL:*FX
229,0