A downloadable game

VIC MINE

VIC MINE is the VIC-20 Version of the C64 Minefield game. The grid size is slightly smaller due to reduced memory on the unexpanded VIC. This will run nicely on the VICE Emulator running in VIC unexpanded mode. Cursor keys move the flashing cursor and space bar will examine a spot for mines. If a mine is present, you lose, otherwise a number will replace the circle to indicate the number of adjacent spots with a mine. F key will flag a spot as a potential mine without examining it.  

1 PRINT"SQSTBY...":DIMM(14,14):DIMN(14,14):C=144:G=7771:FORX=1TO14:FORZY=1TO14

K is the size of the minefield. M array holds mine info, N array holds the number of adjacent mines to each spot. C is the number of non-mine locations. G is upper left of grid on the screen

2 W=(X<>1)*(X<>14)*(Y<>1)*(Y<>14)*INT(RND(0)*1.1):N(X,Y)=0:C=C-W:M(X,Y)=W:NEXT

W randomly places a mine inside the playable area. And decrements C, N array is reset to all zeros. To increase the difficulty, change the 1.1 in the random function to a slightly higher value.

3 NEXT:FORX=2TO13:FORY=2TO13:H=0:FORI=-1TO1:FORJ=-1TO1:H=H+M(X+I,Y+J):NEXT: NEXT:A=38491

Count up the number of mines adjacent to each spot

4 POKEA+X+22*Y,0:N(X,Y)=H:POKEG+X+22*Y,81:NEXT:NEXT:PRINT"S";C;"SQCRSR=MOVE, SPACE=OPEN"

place the grid on the screen, print the remaining open spaces, print instruction

5 S=22*Y+X+G: Z$="OQ|] FX+":X=2:Y=2

S is location on screen given x y coordinates. Z$ is a string of allowable inputs

6 I=0:GETA$:FORT=1TO8:I=I-T*(A$=MID$(Z$,T,1)):NEXT:F=PEEK(S):F=(F=209)OR(F=171)

Get the index number for the user input. f is flag for counting remaining open spaces. 209 is the symbol for unexamined spot, 171 is symbol for flag “+” (also unexamined), any other symbol is for a previously examined spot. 

7 POKES,127ANDPEEK(S):J=M(X,Y):X=X-(I=3)*(X>2)+(I=4)*(X<13):IF(I>5)THENPOKES,43

127and will Un-Reverse video of the symbol at the old cursor location, j is set to 1 if a mine is preset at current cursor location. update X value of cursor. Poke 43 puts a flag on the current space but does not examine it.

8 Y=Y-(I=1)*(Y>2)+(I=2)*(Y<13):S=X+22*Y+G:POKES,128ORPEEK(S):IFC<1THENPRINT"WIN!!"

Move the Y value of the cursor and reverse video character at that location

9 H=N(X,Y):IF(I=5)AND(J=0)THENPOKES,48+H:C=C+F:PRINT"S";C;:GOTO6

If space bar (open) and there is no mine (j=0) then display on the screen the number of adjacent mines. Update count of open spaces remaining

10 PRINT"| ";:IF(I<>5)OR(M(X,Y)=0)THENGOTO6

If a mine is at present cursor and player opens it, end program otherwise goto6 for new input

Download

Download
Prosser 2023 10 line.docx 537 kB
Download
Prosser2023.d64 170 kB
Download
VIC MINE.txt 2.5 kB

Leave a comment

Log in with itch.io to leave a comment.