Minefield
- Type
- Game
- Category
- Short action game
- Author
- John Pershing and Kevin O'Neil
- Published in
- Antic, November 1985 (Vol. 4, No. 7), I/O Board
- Year
- 1985
- Language
- Atari BASIC
- Requirements
- Any Atari 8-bit computer, Atari BASIC, joystick in port 1
- Tags
- antic, short-listing, graphics-7, locate, joystick, io-board, beginner, 1985
About the program
Antic's November 1985 I/O Board (the letters page) had an unusual confession. While cleaning out a workstation, the editors found a reader submission behind a desk, dated March 10, 1984, from John Pershing and Kevin O'Neil. They guessed the authors had "probably forgotten all about it by now", but printed Minefield anyway, because it was "the shortest code we've ever seen for a game". The program's REM spells the names Persing and O'Neill.
The plot fits in one PRINT statement. You have escaped from a prison camp and blundered into a minefield. Get to the right-hand edge alive.
Typing it in
There's only one special character, {CLEAR} in line 40 (ESC then SHIFT-CLEAR). The long PRINT lines 50–65 have no spaces where words meet the line ends (for example escapedfrom), because the authors relied on the 40-column screen wrapping. Type them as shown.
How to play
Press START. Your track starts on the left and moves steadily right, one pixel per step. Push the joystick up or down to change course. Leaving the top or bottom of the screen wraps you round to the other side, which the instructions call "interscreen". Touch a mine (one of the 65 small squares) and you're blown up, and told what percentage of the field you crossed. Press the trigger to fire your stolen laser straight ahead. It burns a line up to the next mine and knocks out one pixel of it. You have five shots, so be thrifty. Each time you get across, the round count goes up.
How it works
The whole game is a FOR X=0 TO 158 loop (lines 1210–1250). Each pass plots your position, reads the joystick and uses LOCATE to look one pixel ahead. Colour 2 means a mine. The laser (lines 3000–3060) walks a second pointer forward until it finds colour 2, then erases its own beam with COLOR 0, except for that one pixel of the mine. The engine noise is SOUND with a slightly random pitch every step.
Variations to try
Increase BOX in line 1100 for a denser minefield, or let the variable C (set but never used) control how many mines appear each round.
Listing
10 REM MINEFIELD
20 REM BY PERSING AND O'NEILL
30 REM ANTIC PUBLISHING
40 ? "{CLEAR}":? :? :? :POKE 752,1
50 ? " In MINEFIELD you have just escapedfrom a Communist prison camp. You havestumbled onto a minefield ";
60 ? "and must escape! You may interscreen but your object is to get to the right edge."
65 ? "You may fire a stolen laser that will destroy one pixel of a mine.Be thriftyfor you only have 5 shots."
70 ? "Best of luck!"
80 ? :? "Press START to begin."
90 IF PEEK(53279)<>6 THEN 90
100 C=60
1000 GRAPHICS 7:SETCOLOR 2,0,0
1100 FOR BOX=1 TO 65:COLOR 2
1110 A=INT(145*RND(0))+5:B=INT(70*RND(0)+1)
1120 PLOT A,B:DRAWTO A+5,B:DRAWTO A+5,B+5:DRAWTO A,B+5:DRAWTO A,B
1130 NEXT BOX
1200 N=40:COLOR 1
1210 FOR X=0 TO 158:POKE 752,1
1215 SOUND 0,N+INT(RND(0)*5)+1,12,5
1220 PLOT X,N
1230 IF STICK(0)=14 THEN N=N-1
1235 IF STICK(0)=13 THEN N=N+1
1240 LOCATE X+1,N,POO:IF POO=2 THEN 2000
1241 IF N=79 THEN N=1
1242 IF N=0 THEN N=78
1243 IF STRIG(0)=0 AND O<=4 THEN 3000
1250 NEXT X
1260 ? "YOU FINISHED!!":C=C+20:R=R+1
1270 ? "PRESS FIRE BUTTON":O=0
1273 ? "YOU FINISHED ";R;" ROUND(S)"
1275 SOUND 0,0,0,0
1280 IF STRIG(0)=1 THEN 1280
1290 GOTO 1000
2000 FOR I=29 TO 243:SOUND 0,I,8,10:NEXT I
2010 ? "YOU COMPLETED ";INT(X/158*100);"% OF MINEFIELD"
2020 GOTO 1270
3000 G=X
3010 COLOR 1:PLOT G,N
3015 SOUND 1,G,10,5
3020 LOCATE G+1,N,KO:IF KO=2 THEN 3050
3030 G=G+1:IF G=158 THEN 3050
3040 GOTO 3010
3050 COLOR 0:PLOT X+1,N:DRAWTO G+1,N
3055 SOUND 1,0,0,0
3060 O=O+1:G=0:COLOR 1:GOTO 1250
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: MINE.BAS.
Credits
- Program listing: Minefield — program listing (Antic, November 1985 (Vol. 4, No. 7), I/O Board) — John Pershing and Kevin O'Neil
- Picture: A short trip: this run ended at the first mine. — John Pershing and Kevin O'Neil (program); screenshot by the site
- Antic, November 1985 - Vol. 4 No. 7: scan of the printed magazine, PDF page 8 (I/O Board) — Internet Archive, 1985
- Antic disk, November 1985 - Vol. 4 No. 7: MINE.BAS (detokenized listing) — John Pershing and Kevin O'Neil, 1985
