10MODE5
20VDU 5
30DIM M$(21)
40PROCsetup
50SA=6:SB=10:LA=418:LB=525:C=5:D=5
60DI=1:S1=0:S2=0:S3=0:S4=0
70IF C=5 AND D=5 THEN GOSUB 700
80IF C=5 AND D=6 THEN GOSUB 910
90IF C=6 AND D=5 THEN GOSUB 1030
100IF C=6 AND D=6 THEN GOSUB 1240
110IF C=4 AND D=5 THEN GOSUB 1360
120IF C=4 AND D=6 THEN GOSUB 1570
130IF C=3 AND D=5 THEN GOSUB 1690
140IF C=3 AND D=6 THEN GOSUB 1900
150IF C=3 AND D=4 THEN GOSUB 2020
160IF C=4 AND D=4 THEN GOSUB 2230
170IF C=5 AND D=4 THEN GOSUB 2440
180IF C=6 AND D=4 THEN GOSUB 2650
190PROCdraw
200PROCdrawyou
210A$=INKEY$(0)
220*FX 15,1
230IF A$="X" AND SB=20 THEN SB=1:LB=LB
+(19*25):LA=LA-(19*50):D=D+1:GOTO 70
240IF A$="X" AND MID$(M$(SB+1),SA,1)="
S" THEN PROCdrawyou:DI=1:SB=SB+1:LA=LA+5
0:LB=LB-25:PROCdrawyou:PROCcollect
250IF A$="X" AND MID$(M$(SB+1),SA,1)="
O" THEN PROCdrawyou:DI=1:SB=SB+1:LA=LA+5
0:LB=LB-25:PROCdrawyou
260IF A$="A" AND SB=1 THEN SB=20:LB=LB
-(19*25):LA=LA+(19*50):D=D-1:GOTO 70
270IF A$="A" AND MID$(M$(SB-1),SA,1)="
S" THEN PROCdrawyou:DI=0:SB=SB-1:LA=LA-5
0:LB=LB+25:PROCdrawyou:PROCcollect
280IF A$="A" AND MID$(M$(SB-1),SA,1)="
O" THEN PROCdrawyou:DI=0:SB=SB-1:LA=LA-5
0:LB=LB+25:PROCdrawyou
290IF A$=":" AND SA=15 THEN SA=1:LB=LB
-(14*25):LA=LA-(14*50):C=C+1:GOTO 70
300IF A$=":" AND MID$(M$(SB),SA+1,1)="
S" THEN PROCdrawyou:DI=0:SA=SA+1:LA=LA+5
0:LB=LB+25:PROCdrawyou:PROCcollect
310IF A$=":" AND MID$(M$(SB),SA+1,1)="
O" THEN PROCdrawyou:DI=0:SA=SA+1:LA=LA+5
0:LB=LB+25:PROCdrawyou
320IF A$="." AND SA=1 THEN SA=15:LB=LB
+(14*25):LA=LA+(14*50):C=C-1:GOTO 70
330IF A$="." AND MID$(M$(SB),SA-1,1)="
S" THEN PROCdrawyou:DI=2:SA=SA-1:LA=LA-5
0:LB=LB-25:PROCdrawyou:PROCcollect
340IF A$="." AND MID$(M$(SB),SA-1,1)="
O" THEN PROCdrawyou:DI=2:SA=SA-1:LA=LA-5
0:LB=LB-25:PROCdrawyou
350GOTO 210
360DEFPROCdraw
370CLS
380FOR B%=1 TO 20:FOR A%=1 TO 15
390IF MID$(M$(B%),A%,1)=" " THEN GOTO
490
400X%=(A%*50)-350+(B%*50)
410Y%=550-(B%*25)+(A%*25)
420IF A%=1 THEN GOTO 440
430IF MID$(M$(B%),A%-1,1)="O" THEN GCO
L 0,2:MOVE X%,Y%:DRAW X%,Y%-20:PLOT 85,X
%+50,Y%+25:PLOT 85,X%+50,Y%+5:GOTO 450
440GCOL 0,2:MOVE X%-50,Y%+25:DRAW X%-5
0,Y%+5:PLOT 85,X%,Y%:PLOT 85,X%,Y%-20
450PLOT 85,X%+50,Y%+25:PLOT 85,X%+50,Y
%+5
460IF MID$(M$(B%),A%,1)="S" THEN GCOL
0,2 ELSE GCOL 0,1
470MOVE X%,Y%:DRAW X%-50,Y%+25
480PLOT 85,X%+50,Y%+25:PLOT 85,X%,Y%+5
0
490NEXT:NEXT
500ENDPROC
510DEFPROCsetup
520VDU 19,2,7,0,0,0
530VDU 19,3,7,0,0,0
540VDU 23,130,24,60,126,126,126,255,25
5,255
550VDU 23,131,255,255,255,126,126,126,
60,24
552VDU 23,132,24,60,126,126,126,255,24
5,255
554VDU 23,133,255,245,251,126,126,126,
60,24
556VDU 23,134,24,60,126,126,126,255,17
5,255
558VDU 23,135,255,175,223,126,126,126,
60,24
560ENVELOPE 1,1,0,0,0,1,1,1,100,-8,-3,
-3,100,30
570ENDPROC
580DEFPROCdrawyou
590GCOL 4,0
600IF DI=0 THEN MOVE LA,LB:VDU 130:MOV
E LA,LB-32:VDU 131
610IF DI=1 THEN MOVE LA,LB:VDU 132:MOV
E LA,LB-32:VDU 133
615IF DI=2 THEN MOVE LA,LB:VDU 134:MOV
E LA,LB-32:VDU 135
620ENDPROC
630DEFPROCcollect
640IF C=6 AND D=6 AND S1=0 THEN S1=1:S
OUND 1,1,50,10
650IF C=3 AND D=6 AND S2=0 THEN S2=1:S
OUND 1,1,50,10
660IF C=3 AND D=4 AND S3=0 THEN S3=1:S
OUND 1,1,50,10
670IF C=6 AND D=4 AND S4=0 THEN S4=1:S
OUND 1,1,50,10
680IF S1=1 AND S2=1 AND S3=1 AND S4=1
THEN VDU 4:CLS:PRINT"Well Done!!":END
690ENDPROC
700M$(1)=" O "
710M$(2)=" O O "
720M$(3)=" O O "
730M$(4)=" O O "
740M$(5)=" O O "
750M$(6)=" OOOOOOO O "
760M$(7)="OOOO O O "
770M$(8)=" O O O "
780M$(9)=" O OOOO "
790M$(10)=" O O O "
800M$(11)=" O O O OO"
810M$(12)=" OOOO O O "
820M$(13)=" OOOOOO O OO"
830M$(14)=" O OOOOOOO "
840M$(15)="OO OOOO O OOO"
850M$(16)=" O O O O "
860M$(17)=" O O O O "
870M$(18)=" OOOOOO OOOO "
880M$(19)=" O "
890M$(20)=" O O "
900RETURN
910M$(1)=" O O "
920M$(2)=" O OOOOOO "
930M$(3)=" OO O O "
940M$(4)=" OO O OO O "
950M$(5)=" OO O OO O "
960M$(6)=" O O OOOO "
970M$(7)=" O O O OO "
980M$(8)="OOOOOOOOO O OO "
990M$(9)=" O "
1000M$(10)=" OOOOOO"
1010FOR A=11 TO 20:M$(A)="
":NEXT
1020RETURN
1030M$(1)=" O "
1040M$(2)=" O "
1050M$(3)=" O OO "
1060M$(4)=" O OOO "
1070M$(5)=" OOO OOO O "
1080M$(6)=" O O O "
1090M$(7)=" O O O "
1100M$(8)=" OOOOOOOOO O "
1110M$(9)=" O OOO "
1120M$(10)=" O OOOOOO "
1130M$(11)="OO O O "
1140M$(12)=" O O "
1150M$(13)="OOOOOOOOO OOO "
1160M$(14)=" O O O "
1170M$(15)="OOOO OO O O "
1180M$(16)=" O OOOOO "
1190M$(17)=" OOOOOO O "
1200M$(18)=" O OOO "
1210M$(19)=" OOOOOOOOO "
1220M$(20)=" O "
1230RETURN
1240M$(1)=" O "
1250M$(2)=" O O "
1260M$(3)=" OOOOOOOO "
1270M$(4)=" OOO O "
1280M$(5)=" O O O O "
1290M$(6)=" OOOO OOOOOO O "
1300M$(7)=" O O O O "
1310M$(8)=" OO OOOOOS OOO "
1320M$(9)=" O O "
1330M$(10)="OOOOOOOOOOOO "
1340FOR A=11 TO 20:M$(A)="
":NEXT
1350RETURN
1360M$(1)=" O O "
1370M$(2)=" O O "
1380M$(3)=" O O "
1390M$(4)=" OOOOOOOOOO "
1400M$(5)=" O OO O "
1410M$(6)=" O OO O "
1420M$(7)=" O OO OOO"
1430M$(8)=" O OO O "
1440M$(9)=" O OOOO O "
1450M$(10)="OOOOOOO OOOO "
1460M$(11)=" OOOO OOOO "
1470M$(12)=" O OOOO O "
1480M$(13)=" O OO O "
1490M$(14)=" OOO OO O "
1500M$(15)=" O O OO OOO"
1510M$(16)="OO O OO O "
1520M$(17)=" OOOOOOOOOO "
1530M$(18)=" O O "
1540M$(19)=" O O "
1550M$(20)=" O O "
1560RETURN
1570M$(1)=" O O "
1580M$(2)=" OO OO "
1590M$(3)=" OOO "
1600M$(4)=" O O OO "
1610M$(5)=" O O O O "
1620M$(6)=" OOOOOO O "
1630M$(7)=" O O O O "
1640M$(8)=" O O O OOOOO"
1650M$(9)=" O O O "
1660M$(10)="OOOOO OOOOOO "
1670FOR A=11 TO 20:M$(A)="
":NEXT
1680RETURN
1690 M$(1)=" O "
1700 M$(2)=" O "
1710 M$(3)=" OOOOOOOOO "
1720 M$(4)=" O O O O O "
1730 M$(5)=" OOOOOOOOO "
1740 M$(6)=" O O O O O "
1750 M$(7)=" OOOOOOOOO "
1760 M$(8)=" O O O O O "
1770 M$(9)=" OOOOOOOOO "
1780M$(10)=" O O O O OO"
1790M$(11)=" OOOOOOOOO "
1800M$(12)=" O O O O O "
1810M$(13)=" OOOOOOOOO "
1820M$(14)=" O O O O O "
1830M$(15)=" OOOOOOOOO "
1840M$(16)=" O O O O OO"
1850M$(17)=" OOOOOOOOO "
1860M$(18)=" O O O O "
1870M$(19)=" OOOOOOO "
1880M$(20)=" O "
1890RETURN
1900M$(1)=" O "
1910M$(2)=" O "
1920M$(3)=" OOOOOOOOO "
1930M$(4)=" O O O "
1940M$(5)=" O O O "
1950M$(6)=" OOOOO OOO "
1960M$(7)=" O O O O "
1970M$(8)=" O O OOO "
1980M$(9)=" O O "
1990M$(10)=" S OOOOOOOO"
2000FOR A=11 TO 20:M$(A)="
":NEXT
2010RETURN
2020 M$(1)=" "
2030 M$(2)=" OOOO SO "
2040 M$(3)=" O O "
2050 M$(4)=" OOOOO O "
2060 M$(5)=" O OOO "
2070 M$(6)=" OOOO O "
2080 M$(7)=" O OO"
2090 M$(8)=" O OOOOO "
2100 M$(9)=" O O O "
2110M$(10)=" OOO O O "
2120M$(11)=" O OOO OO"
2130M$(12)=" O O "
2140M$(13)=" OOO O "
2150M$(14)=" O OOOO "
2160M$(15)=" O O O "
2170M$(16)=" OO O OOO"
2180M$(17)=" O O "
2190M$(18)=" OOOOO "
2200M$(19)=" O "
2210M$(20)=" O "
2220RETURN
2230 M$(1)=" "
2240 M$(2)=" OOO O "
2250 M$(3)=" OOO O O "
2260 M$(4)=" O O OOO "
2270 M$(5)=" O O O O "
2280 M$(6)=" OOO O O O "
2290 M$(7)="OO O O OOOO O "
2300 M$(8)=" OOOO O O O "
2310 M$(9)=" O O O OO"
2320M$(10)=" OO O O O O "
2330M$(11)="OO OOO OOO O "
2340M$(12)=" OOO O O O "
2350M$(13)=" O O O "
2360M$(14)=" OO OO O O "
2370M$(15)=" O O OOO OO"
2380M$(16)="OO O OOO O O "
2390M$(17)=" O O O OOO OOO "
2400M$(18)=" OOO O O O "
2410M$(19)=" OO OOO "
2420M$(20)=" O O "
2430RETURN
2440 M$(1)=" "
2450 M$(2)=" OOOO "
2460 M$(3)=" O O "
2470 M$(4)=" OO O "
2480 M$(5)=" OOOOOO O O "
2490 M$(6)=" O O O OO"
2500 M$(7)=" O O O OO"
2510 M$(8)=" OOO O OO "
2520 M$(9)="OOO O O O O O"
2530M$(10)=" O OOOO OOO"
2540M$(11)=" O O O "
2550M$(12)=" OOOOO OOOOOO"
2560M$(13)=" O O "
2570M$(14)=" OOO O "
2580M$(15)="OO OO OOOOOO O"
2590M$(16)=" O O O O"
2600M$(17)=" O O O "
2610M$(18)=" OOOOOO "
2620M$(19)=" O "
2630M$(20)=" O "
2640RETURN
2650 M$(1)=" "
2660 M$(2)=" OOOOOOOS "
2670 M$(3)=" O "
2680 M$(4)=" O OOOOO "
2690 M$(5)=" O OOO O "
2700 M$(6)="OOOOOOO O O "
2710 M$(7)="O O OO "
2720 M$(8)=" OOOOOOOOOO O "
2730 M$(9)="OO OO O "
2740M$(10)="O OOO OOOOO "
2750M$(11)=" O O OOOO "
2760M$(12)="OOO O O O OOO "
2770M$(13)=" O OOO OOO O "
2780M$(14)=" O O O "
2790M$(15)="O OO O OOO O "
2800M$(16)="O OOOO O OOO "
2810M$(17)=" O O OO "
2820M$(18)=" OOOOOO "
2830M$(19)=" O "
2840RETURN