Compucolor.org – Virtual Media

Listing of file='SIMON.BAS;01' on disk='vmedia/board_games-sector.ccvf'

2 REM  WRITTEN BY RON COWLING
5 PLOT 12
10 PLOT 6,2,14
12 PRINT "TO PLAY,PUSH THE COLOUR KEYS ON THE COLOUR PAD"
14 PRINT "IN THE SAME SEQUENCE THAT THEY ARE DISPLAYED"
15 REM  LOADS MACHINE CODE SUBROUTINE FOR SQUARE DISPLAY
20 FOR X= 40960TO 40991
24 READ A:POKE X,A
28 NEXT
29 PRINT :PRINT
30 INPUT "WHAT LEVEL DO YOU WANT TO PLAY AT?(1,2,3 OR 4)";L1
35 IF L1> 0AND L1< 5THEN 40
37 PLOT 28,11:GOTO 30
40 ON L1GOTO 41,42,43,44
41 L= 9:GOTO 50
42 L= 12:GOTO 50
43 L= 20:GOTO 50
44 L= 32:GOTO 50
50 PLOT  12,6,3,2,3,3,242,3,60,44,60,44,3,3,3,255
52 PLOT 2,3,67,242,3,124,44,124,44,67,3,67,255
54 PLOT 2,67,67,242,67,124,108,124,108,67,67,67,255
56 PLOT 2,67,3,242,67,60,108,60,108,60,108,3,67,3,255
60 PLOT 6,2,3,25,0,14:PRINT  "SIMON"
65 PLOT 3,25,2:PRINT "SAYS"
70 PLOT  6,3,3,25,8:PRINT "LEVEL"
72 PLOT 3,26,10:PRINT L1
80 GOTO 60000:REM  LOADS SOUNDWARE PATCH
90 LO= PEEK (32940)+ PEEK (32941)* 256+ 1
95 PLOT 6,6,3,25,16:PRINT "SCORE"
100 DIM AR(40),AS(40)
120 POKE 40974,0
130 PLOT 27,19
200 R= INT (4* RND (1)+ 1):REM  PICKS NEXT COLOUR SQUARE
205 PLOT 6,6,3,26,18:PRINT B
210 B= B+ 1
220 AR(B)= R
222 IF R= 1THEN AS(B)= 17
224 IF R= 2THEN AS(B)= 18
226 IF R= 3THEN AS(B)= 21
228 IF R= 4THEN AS(B)= 22
229  REM  THIS LOOP DISPLAYS SEQUENCE OF SQUARES SO FAR
230 FOR C= 1TO B
250 ON AR(C)GOSUB 1000,2000,3000,4000
260 NEXT C
280 POKE 33278,0
290 C= 1
300 IF C= B+ 1GOTO 400
310  REM  THIS LOOP CHECKS CORRECT KEY IS PUSHED
320 FOR Z= 1TO 70
330 IF PEEK (33278)= AS(C)THEN 370
335 IF PEEK (33278)< > 0AND PEEK (33278)< > AS(C)THEN 600
340 NEXT Z
350 GOTO 600
370 POKE 33278,0
380 ON AR(C)GOSUB 1000,2000,3000,4000
390 C= C+ 1:GOTO 300
395 END
400 IF C= L+ 1THEN 800
500 FOR N= 1TO 200:NEXT
510 GOTO 200
600 REM  LOOSING SOUND ROUTINE
601 PLOT 6,70,3,25,18:PRINT "LOSE"
602 ON AR(C)GOSUB 1500,2500,3500,4500
603 D= 45:E= 100
605 FOR X= 1TO 3
610 POKE LO,D:POKE LO+ 1,1:POKE LO+ 2,55
620 Y= CALL (0)
630 FOR N= 1TO 25:NEXT N
640 NEXT X
650 POKE LO,E:POKE LO+ 1,1:POKE LO+ 2,220
660 Y= CALL (0)
670 IF  D= 45 THEN  D= 55:E= 110:GOTO  605
690 POKE  LO+ 1,0
710 GOSUB 5500
720 GOTO 870
800 REM  WINNING SOUND ROUTINE
802 PLOT 6,70,3,26,18:PRINT "WIN"
805 GOSUB 1500:GOSUB 2500:GOSUB 3500:GOSUB 4500
810 H= 200:I= 0:J= 80:K= 0:GOSUB  990
820 H= 130:J= 130:K= 0:GOSUB 990
830 H= 180:J= 50:K= 0:GOSUB 990
840 H= 130:J= 0:K= 2:GOSUB 990
850 H= 190:J= 60:K= 0:GOSUB 990
860 H= 130:J= 0:K= 2:GOSUB 990
870 PLOT 6,2,15,3,23,25:PRINT "TO PLAY":PLOT 3,23,26:PRINT "AGAIN"
880 PLOT 3,23,27:PRINT "PUSH ENTER"
885 INPUT "";XX:RUN
990 POKE LO,H:POKE LO+ 1,I:POKE LO+ 2,J:POKE LO+ 3,K:Y= CALL (0)
992 RETURN
1000 REM  RED SQUARE DISPLAY
1010 POKE 40974,9
1020 POKE 40964,133:POKE 40965,96
1025 PLOT 27,19
1030 POKE LO,175
1035 POKE LO+ 2,250
1040 Y= CALL (0)
1050 POKE 40974,0
1060 PLOT 27,19
1070 RETURN
1080 REM  ********************
1500 POKE 40964,133:POKE 40965,96
1505 POKE 40974,9
1510 PLOT 27,19
1520 RETURN
2000 REM  GREEN SQUARE DISPLAY
2010 POKE 40974,18
2020 POKE 40964,133:POKE 40965,104
2025 PLOT 27,19
2030 POKE LO,200
2035 POKE LO+ 2,225
2040 Y= CALL (0)
2050 POKE 40974,0
2060 PLOT 27,19
2070 RETURN
2080 REM  ********************
2500 POKE 40964,133:POKE 40965,104
2505 POKE 40974,18
2510 PLOT 27,19
2520 RETURN
3000 REM  MAGENTA SQUARE DISPLAY
3010 POKE 40974,45
3020 POKE 40964,197:POKE 40965,96
3025 PLOT 27,19
3030 POKE LO,225
3035 POKE LO+ 2,200
3040 Y= CALL (0)
3050 POKE 40974,0
3060 PLOT 27,19
3070 RETURN
3080 REM  ********************
3500 POKE 40964,197:POKE 40965,96
3505 POKE 40974,45
3510 PLOT 27,19
3520 RETURN
4000 REM  CYAN SQUARE DISPLAY
4010 POKE 40974,54
4020 POKE 40964,197:POKE 40965,104
4025 PLOT 27,19
4030 POKE LO,250
4035 POKE LO+ 2,175
4040 Y= CALL (0)
4050 POKE 40974,0
4060 PLOT 27,19
4070 RETURN
4080 REM  *********************
4500 POKE 40964,197:POKE 40965,104
4505 POKE 40974,54
4510 PLOT 27,19
4520 RETURN
5500 POKE 40974,0
5510 PLOT 27,19
5520 RETURN
49990 REM  DATA FOR SQUARE DISPLAY SUBROUTINE
50000 DATA 245,229,197,33,133,96,17,88,0,14,14
50010 DATA 6,20,54,9,35,35,5,120,194,13,160
50020 DATA 25,13,121,194,11,160,193,225,241,201
59990 REM  SOUNDWARE PATCH
60000 TM= PEEK (32940)+ PEEK (32941)* 256
60010 IF TM> 65500THEN 60060
60020 POKE TM+ 1,50:POKE TM+ 3,15
60030 REM   60027 CHECKS IF MACHINE LANGUAGE ALREADY LOADED
60040 A= 0:FOR N= TM+ 176TO TM+ 182:A= A+ PEEK (N):NEXT
60050 IF A= 1445THEN 60150
60060 AD= 32940:TM= TM- 200:DA= TM:GOSUB 60160:CLEAR 100
60070 TM= PEEK (32940)+ PEEK (32941)* 256
60090 RESTORE 60190
60100 REM   60050 LOADS MACHINE LANGUAGE
60110 FOR N= 1TO 200:READ A:IF A> 255THEN N= 220:GOTO 60140
60120 IF A< 0THEN DA= TM- A:AD= TM+ N:GOSUB 60160:GOTO 60140
60130 POKE TM+ N,A
60140 NEXT
60150 AD= 33283:DA= TM+ 8:GOSUB 60160
60151 GOTO 90
60160 Z1= INT (DA/ 256):Z2= DA- Z1* 256
60170 POKE AD,Z2:N= N+ 1:POKE AD+ 1,Z1:RETURN
60180 REM        MACHINE LANGUAGE DATA
60190 DATA 50,0,15,0,0,0,0,123,254,0,194,-121,30,8,243
60200 DATA 58,-6,87,58,-7,254,0,194,-33,122,50,-7,42,-1
60210 DATA 34,-49,42,-3,34,-46,33,-22,1,50,0,11,120,177
60220 DATA 194,-51,123,238,2,211,4,95,43,124,181,194
60230 DATA -48,58,-5,254,0,202,-100,61,50,-5,58,-49,130
60240 DATA 50,-49,58,-7,103,122,50,-7,84,195,-45,50,-7
60250 DATA 50,-4,50,-2,62,15,50,-3,62,50,50,-1,251,201
60260 DATA 254,1,194,-158,33,0,0,6,4,14,17,17,128,0,25
60270 DATA 126,17,128,255,25,119,35,0,13,194,-133,17,8
60280 DATA 0,25,5,194,-131,201
60290 DATA 254,2,194,-182,245,229,197,205,36,0,194,-166
60300 DATA 95,175,87,50,255,129,193,225,241,201,201
60310 DATA 300
60320 REM   (BACK TO GREEN PRINT)