8-Bit Software Online Conversion
Multicolour Puzzle Game - Listing
10REM `````````````````````````````
20REM MULTICOLOUR
30REM
40REM (C)1984 A. BLUNDELL
50REM `````````````````````````````
60:
70ONERRORRUN
80*KEY10OLD|M|NL.|M
90MODE1
100VDU23;8202;0;0;0;
110PROCtitle
120REPEAT
130MODE1
140VDU23;8202;0;0;0;
150PROCintro
160PROCinit
170MODE2
180VDU23;8202;0;0;0;
190VDU28,2,28,17,27
200REPEAT
210PROCreset
220PROCdisplay
230REPEAT
240PROCmove
250PROCcheck
260UNTILfinish%
270IFfinish%>0THENPROCwinELSEPRINT"No
more moves";
280PRINT'" ANOTHER GAME?";
290play%=GET
300UNTIL(play%OR32)<>121
310VDU26:CLS
320PRINT'"Anyone else care to try?";
330play%=GET
340UNTIL(play%OR32)<>121
350MODE6
360END
370:
380REM------------------------------
390REM PROCEDURES
400REM------------------------------
410DEFPROCtitle
420COLOUR2
430PRINT'''''''TAB(12)"------------"'T
AB(12)"MULTICOLOUR."'TAB(12)"-----------
-"''''''''
440COLOUR1
450PRINT" A manipulative puzzle in c
olour"'''''''
460COLOUR7
470PRINTTAB(8)"(c)1984 A. BLUNDELL."
480wait%=INKEY(500)
490ENDPROC
500
510DEFPROCinit
520DIM r%(25),c%(25),move%(8,8),dots%(
5),chk%(5)
530FORloop%=1TO25
540READr%(loop%)
550NEXT
560FORloop%=1TO25
570READc%(loop%)
580NEXT
590FORloop%=0TO8
600FORl%=0TO8
610move%(loop%,l%)=-1
620NEXT
630NEXT
640VDU23,240,&7C7C;&7C7C;&7C7C;&7C7C;
650VDU23,241,&FFFF;&FFFF;&FFFF;&FFFF;
660ENDPROC
670
680DATA1,2,2,2,3,3,3,3,3,4,4,4,4,4,4,4
,5,5,5,5,5,6,6,6,7
690DATA4,3,4,5,2,3,4,5,6,1,2,3,4,5,6,7
,2,3,4,5,6,3,4,5,4
700
710DEFPROCintro
720CLS
730COLOUR2
740PRINT'TAB(12)"------------"'TAB(12)
"MULTICOLOUR."'TAB(12)"------------"'''
750COLOUR1
760PRINT"'MULTICOLOUR' is played on a
diamond - shaped grid using 5 each of 5
different coloured counters."''
770COLOUR3
780PRINT"The counters must be placed o
n the grid in such a way that no 2 count
ers of the same colour are next to one a
nother - horizontally, vertically or d
iagonally."''
790COLOUR2
800PRINT"Can you fit them all in ??"''
''
810COLOUR3:PRINT"Press <";:COLOUR1:PRI
NT"RETURN";:COLOUR3
820INPUT">"null$
830ENDPROC
840
850DEFPROCreset
860FORloop%=1TO5
870dots%(loop%)=5
880NEXT
890FORloop%=1TO25
900move%(r%(loop%),c%(loop%))=0
910NEXT
920ENDPROC
930
940DEFPROCdisplay
950CLG
960GCOL0,6
970FORloop%=1TO25
980PROCbox(r%(loop%),c%(loop%))
990NEXT
1000GCOL0,7
1010FORloop%=1TO25
1020PROCletter(r%(loop%),c%(loop%),loop
%)
1030NEXT
1040VDU5
1050FORloop%=1TO5
1060GCOL0,loop%
1070MOVE970,800-loop%*64
1080VDU240,240,240,240,240
1090NEXT
1100VDU4
1110GCOL0,4
1120PLOT4,100,170
1130PLOT4,1180,170
1140PLOT85,100,70
1150PLOT85,1180,70
1160COLOUR3
1170COLOUR132
1180CLS
1190ENDPROC
1200
1210DEFPROCbox(y%,x%)
1220PLOT4,x%*128-96,1000-y%*96+32
1230PLOT5,x%*128+32,1000-y%*96+32
1240PLOT5,x%*128+32,1000-y%*96-64
1250PLOT5,x%*128-96,1000-y%*96-64
1260PLOT5,x%*128-96,1000-y%*96+32
1270ENDPROC
1280
1290DEFPROCletter(y%,x%,letter%)
1300VDU5
1310MOVEx%*128-64,1000-y%*96
1320VDUletter%+64
1330VDU4
1340ENDPROC
1350
1360DEFPROCmove
1370REPEAT
1380col%=RND(5)
1390UNTILdots%(col%)>0
1400VDU5
1410MOVE910+64*dots%(col%),800-col%*64
1420GCOL0,col%+8
1430VDU240
1440VDU4
1450PRINT"your choice? ";
1460*FX21,0
1470REPEAT
1480REPEAT
1490choice%=GET
1500UNTILchoice%>64ANDchoice%<90
1510choice%=choice%-64
1520UNTILmove%(r%(choice%),c%(choice%))
=0
1530PRINTCHR$(choice%+64)
1540GCOL0,col%
1550VDU5
1560MOVE910+64*dots%(col%),800-col%*64
1570VDU240
1580VDU4
1590ENDPROC
1600
1610DEFPROCcheck
1620ok%=1
1630RESTORE1710
1640FORloop%=1TO8
1650READx%,y%
1660IFmove%(r%(choice%)+x%,c%(choice%)+
y%)=col%THENok%=0:loop%=9
1670NEXT
1680IFok%THENPROCvalid ELSEPROCinvalid
1690ENDPROC
1700
1710DATA0,-1,0,1,-1,-1,-1,0,-1,1,1,-1,1
,0,1,1
1720
1730DEFPROCvalid
1740VDU5
1750MOVE910+64*dots%(col%),800-col%*64
1760GCOL0,0
1770VDU240
1780VDU4
1790GCOL0,col%
1800PROCletter(r%(choice%),c%(choice%),
177)
1810dots%(col%)=dots%(col%)-1
1820move%(r%(choice%),c%(choice%))=col%
1830finish%=1
1840FORloop%=1TO5
1850IFdots%(loop%)>0THENfinish%=0
1860NEXT
1870CLS
1880ENDPROC
1890
1900DEFPROCinvalid
1910PRINT"*Invalid move*"
1920SOUND0,-7,2,9
1930finish%=-1
1940FORloop%=1TO7
1950FORl%=1TO7
1960IFmove%(loop%,l%)<>0THEN2080
1970FORlp%=1TO5
1980chk%(lp%)=1
1990NEXT
2000RESTORE1710
2010FORlp%=1TO8
2020READx%,y%
2030IFmove%(loop%+x%,l%+y%)>0THENchk%(m
ove%(loop%+x%,l%+y%))=0
2040NEXT
2050FORlp%=1TO5
2060IFchk%(lp%)THENIFdots%(lp%)THENfini
sh%=0:loop%=8:l%=8
2070NEXT
2080NEXT
2090NEXT
2100ENDPROC
2110
2120DEFPROCwin
2130VDU28,2,29,17,26
2140CLS
2150PRINT"CONGRATULATIONS"
2160PRINT" You made it!";
2170ENVELOPE 1,4,1,-1,0,2,1,0,60,-9,0,-
4,120,30
2180FORloop%=0TO1:FORl%=0TO9:SOUND1,1,6
1+4*l%,5:NEXT:NEXT
2190ENDPROC