MINES

This game is well known as Minesweeper from MS Windows. Enter the coordinates in the range X:(1-4), Y:(0-9). To finish the game succesfully, you need to reveal all the empty fields. By changing the R variable you may set the field width.
You will need a table like the one below to play the game.
0123456789
1          
2          
3          
4          

Source code (665 B)


CLRT
PRINT"MINES
R=10
A=
B=
C=
D=
Z=
INPUT M
FPART M=>RAND
LABEL 2
CLRT
PRINT"PLACE (X.Y)
INPUT S
E=INT S-1
IF 5<ABS (πE-5 GOTO 2
F=7-INT (10FPART S
IF 8-F>R GOTO 2
IF 0≠Z GOTO 7
CLRT
PRINT"MIXING ..
LABEL 6
STATxy
DATA INT 4RANDOM+1,9-INT RRANDOM
IF Σx+9Σy=E+9F+19 GOTO 6
Y=
GOSUB 1
IF X≠0 GOTO 6
Y=1
GOSUB 1
Z=Z+1
IF Z<INT M GOTO 6
Z=
LABEL 7
θ=
STATxy
DATA E,F
LABEL 4
Y=
DATA 0,1
GOSUB 1
IF n=7 GOTO 5
θ=θ+2FPART .5X
IF Σy-F<=2 GOTO 4
CLRT
DATA 1,-3
PRINT"SEEKING ..
IF n<13 GOTO 4
CLRT
PRINT"OKOLO
PRINT θ
WAIT 3
IF Z+2M<8R GOTO 2
PRINT"WELL DONE!
END
LABEL 1
X=
IF Σx=1 GOTO A
IF Σx=2 GOTO B
IF Σx=3 GOTO C
IF Σx≠4 GOTO 3
X=D
D=D+Y10^Σy
GOTO 3
LABEL A
X=A
A=A+Y10^Σy
GOTO 3
LABEL B
X=B
B=B+Y10^Σy
GOTO 3
LABEL C
X=C
C=C+Y10^Σy
LABEL 3
X=INT (10FPART (.1X10^-Σy
RETURN
LABEL 5
Y=2-X
Z=Z+Y
GOSUB 1
IF 1≠Y GOTO 4
CLRT
PRINT"MINE!