Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (74 sloc) 1.82 KB
100 GOSUB 1000:REM INIT
110 GOSUB 2000:REM TITLE
120 GOSUB 3000:REM INIT GAME
130 GOSUB 5000:REM GAME
140 GOTO110
1000 REM -- INIT PRG
1010 REM
1020 POKE 53280,0:POKE53281,0
1030 DIM PZ(15,15):DIM PF(15,15)
1990 RETURN
2000 REM -- TITLE
2990 RETURN
3000 REM -- INIT GAME
3010 REM
3020 FOR Y=0 TO 14:FOR X=0 TO 14
3030 PZ(X,Y)=0
3040 PF(X,Y)=1+INT(RND(0)*14)
3050 NEXT X:NEXT Y
3100 FOR Y=0 TO 25:PRINT:NEXT Y
3990 RETURN
5000 REM -- GAME
5010 REM
5020 FOR Y=0 TO 14: FOR X=0 TO 14
5030 POKE 1024+X+Y*40,PZ(X,Y)
5040 POKE 55296+X+Y*40,PF(X,Y)
5050 NEXT X:NEXT Y
5100 NC = 1
5110 POKE 1024+20,0:POKE55296+20,NC
5120 GET K$:IF K$="" THEN GOTO 5120
5130 IF ASC(K$)=27 THEN END
5140 IF ASC(K$)=13 THEN GOTO 5200
5150 IF ASC(K$)=17 THEN NC=NC+1
5160 IF NC>15 THEN NC=1
5170 IF ASC(K$)=145THEN NC=NC-1
5180 IF NC<1 THEN NC=15
5185 FOR W=0 TO 100:NEXT W
5190 GOTO 5110
5200 REM -- GAMELOOP
5210 REM
5220 POKE 1024,4
5225 OC=PF(0,0)
5230 F=0:REM FINISHED
5240 FOR Y=0 TO 14: FOR X=0 TO 14
5260 CZ=PEEK(1024+X+Y*40)
5270 IFCZ=0 THEN GOTO 5480
5280 F=1
5290 PZ(X,Y)=CZ-1
5300 IFCZ<>1 THEN GOTO 5320
5310 PF(X,Y)=NC
5320 IF CZ<>3 THEN GOTO 5480
5330 IF PEEK(1025+X+Y*40)<>0 THEN GOTO 5360
5340 IF PF(X+1,Y)<>OC THEN GOTO 5360
5350 PZ(X+1,Y)=3
5360 IF PEEK(1064+X+Y*40)<> 0 THEN GOTO 5410
5390 IF PF(X,Y+1)<>OC THEN GOTO 5410
5400 PZ(X,Y+1)=3
5410 IF Y=0 THEN GOTO5440
5415 IF PEEK(984+X+Y*40)<>0 THEN GOTO 5440
5420 IF PF(X,Y-1)<>OC THEN GOTO 5440
5430 PZ(X,Y-1)=3
5440 IF X=0 THEN GOTO 5480
5450 IF PEEK(1023+X+Y*40)<>0 THEN GOTO5480
5460 IF PF(X-1,Y)<>OC THEN GOTO5480
5470 PZ(X-1,Y)=3
5480 NEXTX:NEXTY
5500 FOR Y=0 TO 14: FOR X=0 TO 14
5505 POKE 1024+X+Y*40,15
5506 POKE 55296+X+Y*40,1
5510 POKE 1024+X+Y*40,PZ(X,Y)
5520 POKE 55296+X+Y*40,PF(X,Y)
5530 NEXT X:NEXT Y
5540 IFF=1THEN GOTO 5230
5550 GOTO 5000
READY.