Alpha Run

Type
Education
Category
Educational action game (alphabet and number order)
Author
Stephen Groll
Published in
Antic, October 1983 (Vol. 2, No. 7)
Year
1983
Language
Atari BASIC
Requirements
Any Atari 8-bit, Atari BASIC, joystick in port 1
A GRAPHICS 2 screen with a brown border wall, the letters A to Z scattered in green, ten round purple bombs in a pattern, the car at the left edge and TIME=0 below

About the program

Alpha Run, by Stephen Groll, appeared in Antic in October 1983. The article describes it as a race, or chase, over letters or numbers in sequence, without exploding the bombs in the way. You drive a little blue race car with the joystick and run over A, then B, then C, and so on, or the numerals 1 to 9. Each correct one vanishes as you collect it. Hit a bomb, a wall or a character out of order, and everything blows up. Antic presented it as a game that teaches young children the order of the alphabet and numbers and builds hand-eye coordination, while being enough of a challenge to keep adults interested.

Typing it in

The program is short and almost all plain BASIC. The menus print inverse lowercase text ({inv}…{/inv}: type it with the Atari or inverse key). In GRAPHICS 1 and 2, lowercase and inverse characters come out as capitals in different colours. The DATA in lines 9510–9540 redefines seven characters: the car facing in four directions, the bomb, the explosion and the wall. Lines 9600 and 10000 hold the screen positions used for the title animation and for the bombs.

How to play

While the screen says "please stand by", the program copies the character set into RAM. Then push the joystick forward for a number run or pull it back for an alphabet run. Next, forward picks a time run and back a countdown run.

  • Time run is open-ended, which suits beginners. Your score is the time the run takes, and the program remembers your best time. The article suggests giving players of different abilities a handicap.
  • Countdown run gives you a time limit, which gets shorter after each successful round. A round of numbers scores 10 points and a round of letters 30, plus one point for each time unit left. If time runs out, the bombs go off.

When you've collected the whole sequence, the bombs become harmless. Drive over all ten to finish the round. To get past an unwanted letter or a bomb, press the button while you move, and the car jumps over one square. In the time run each jump adds three units to your time.

How it works

The screen is GRAPHICS 2 with a RAM character set. Line 10 lowers RAMTOP by five pages, and line 30 copies the 1,024-byte ROM font from 57344 into the space above it. Line 9000 places the letters (lower-case codes 97–122) or the digits (codes 17–25, which show as 1–9 in a different colour) in random empty cells, using LOCATE to avoid collisions. During play, line 4040 LOCATEs the square the car is about to enter. If it holds the next character it's the right one (OB=GNU, line 4050). A bomb (224) after the sequence is complete is defused, and anything else that isn't a blank sets off the chain of explosions in lines 6000–6030. The countdown timer adds 0.05 each time round the loop (TCNT), so the displayed time drops by one about every 20 passes through the main loop.

The time limit shrinks after every completed run: by one for the numbers (never below 9, line 9200) and by five for the alphabet (never below 35, line 9210). As published, line 9210 set a misspelt variable, so the alphabet limit kept shrinking below 35; the listing here is corrected (see "Changes from the published listing").

Variations to try

Change NU, LGNU and LL in lines 155–160 to run through other sequences, such as only the first ten letters for very young players. You could also move the bombs by editing the DATA in line 10000.

Changes from the published listing

Line As published Now Why
9210 …IF LTIM=30 THEN LTIME=35 …IF LTIM=30 THEN LTIM=35 A misspelt variable: LTIME is never used, so the alphabet time limit kept shrinking by five every round instead of stopping at 35.

Listing

1 REM ** ALPHA RUN ** ANTIC MAGAZINE **
5 X=0:Y=5:TRAP 6000
10 POKE 106,PEEK(106)-5:GRAPHICS 18
15 POSITION 2,5:? #6;"please stand by."
20 STLL=(PEEK(106)+1)*256
30 FOR MM=0 TO 1023:POKE STLL+MM,PEEK(57344+MM):NEXT MM
50 OCHR=8:GOSUB 130:OCHR=24:GOSUB 130:OCHR=32:GOSUB 130:OCHR=40:GOSUB 130:OCHR=256:GOSUB 130:OCHR=480:GOSUB 130
60 OCHR=80:GOSUB 130:GOTO 135
130 FOR MM=0 TO 7:READ V:POKE OCHR+STLL+MM,V:NEXT MM:RETURN
135 GOSUB 9250
140 HPTS=0:BTIM=90000
145 GRAPHICS 17:POSITION 3,2:? #6;"PUSH JOYSTICK":POSITION 4,5:? #6;"FORWARD FOR":POSITION 4,8:? #6;"{inv}number  run{/inv}"
147 POSITION 9,11:? #6;"or"
150 POSITION 3,14:? #6;"PULL JOYSTICK":POSITION 5,17:? #6;"BACK FOR":POSITION 3,20:? #6;"{inv}alphabet  run{/inv}"
152 IF STICK(0)<>15 THEN 152
155 IF STICK(0)=14 THEN LGNU=26:NU=17:LL=9:LTIM=20:GOTO 170
160 IF STICK(0)=13 THEN LGNU=123:NU=97:LL=26:LTIM=70:GOTO 170
165 GOTO 155
170 POSITION 4,8:? #6;" {inv}TIME RUN{/inv}  "
175 POSITION 9,11:? #6;"or"
180 POSITION 3,20:? #6;"{inv}COUNTDOWN RUN{/inv}"
182 IF STICK(0)<>15 THEN 182
185 IF STICK(0)=14 THEN TP=7400:TIGS=7600:TCNT=1:GOTO 190
187 IF STICK(0)=13 THEN TP=7300:TIME=0:TIGS=7500:TCNT=0.05:GOTO 190
188 GOTO 185
190 WX=0:WY=0:TIME=0:TIMEL=LTIM:PP=0:ADTIM=0
195 GRAPHICS 18:POKE 756,STLL/256
200 FOR L=1 TO 20:POSITION WX,WY:WX=WX+1:? #6;CHR$(42):NEXT L:IF WY=0 THEN WY=10:WX=0:GOTO 200
205 WX=0:WY=0
210 FOR L=1 TO 11:POSITION WX,WY:? #6;CHR$(42):WY=WY+1:NEXT L:IF WX=0 THEN WX=19:WY=0:GOTO 210
300 FOR L=1 TO 10:READ XX,YY:POSITION XX,YY:PRINT #6;CHR$(224):NEXT L:RESTORE 10000
310 POSITION 1,5:? #6;CHR$(163)
320 GOSUB 9000:GOSUB TP
400 S=7:X=1:Y=5
450 IF STICK(0)=15 THEN 450
500 TIME=TIME+TCNT:IF TIME>=1 THEN GOSUB TIGS:TIME=0:IF STICK(0)=15 THEN FOR T=1 TO 19:NEXT T
505 FOR T=1 TO 20:NEXT T:POKE 77,0
510 S=STICK(0):SG=STRIG(0)
540 IF STICK(0)=15 THEN SOUND 0,255,6,1
550 IF STICK(0)<>15 THEN SOUND 0,70,6,4
1000 IF PP=10 AND TP=7400 THEN SOUND 0,0,0,0:GOTO 9100
1005 IF PP=10 AND TP=7300 THEN SOUND 0,0,0,0:GOTO 9200
1007 IF S=14 THEN D=1:GOSUB 3000:Y=Y-1:CARHED=161:GOSUB 4000
1010 IF S=7 THEN GOSUB 3000:X=X+1:CARHED=163:GOSUB 4000
1012 IF S=11 THEN GOSUB 3000:X=X-1:CARHED=164:GOSUB 4000
1014 IF S=13 THEN GOSUB 3000:Y=Y+1:CARHED=165:GOSUB 4000
2000 GOTO 500
3000 POSITION X,Y:PRINT #6;" ":RETURN
4000 IF STRIG(0)=0 THEN GOSUB 7000
4040 LOCATE X,Y,OB
4045 IF OB=224 AND GNU=LGNU THEN GOSUB 5000:GOTO 1000
4050 IF OB=GNU THEN GOTO 8000
4060 IF OB<>32 THEN GOTO 6000
4500 POSITION X,Y:PRINT #6;CHR$(CARHED):RETURN
5000 POSITION X,Y:PRINT #6;CHR$(92):FOR T=1 TO 7:SOUND 1,40,8,15:SOUND 2,70,2,15
5010 NEXT T:SOUND 1,0,0,0:SOUND 2,0,0,0:PP=PP+1:RETURN
5500 POSITION BX,BY-1:PRINT #6;CHR$(92):FOR T=1 TO 10:SOUND 1,50,8,15:NEXT T:SOUND 1,0,0,0:PP=PP+1:RETURN
6000 TRAP 6000:SOUND 0,0,0,0:FOR L=1 TO 10:READ A,B
6005 LOCATE A,B,BO
6010 IF BO=32 THEN NEXT L:IF L=11 THEN RESTORE 10000:GOTO 6100
6020 POSITION A,B:? #6;CHR$(92):FOR T=1 TO 7:SOUND 2,40,8,15:SOUND 1,30,8,15:NEXT T
6030 SOUND 2,0,0,0:SOUND 1,0,0,0:POSITION A,B:? #6;" ":NEXT L:RESTORE 10000
6050 IF PTS>HPTS THEN HPTS=PTS
6100 GRAPHICS 18:POSITION 5,0:? #6;"{inv}game over{/inv}":IF TP=7400 THEN 9105
6105 POSITION 1,2:? #6;"{inv}SCORE={/inv}";PTS:POSITION 1,4:? #6;"{inv}high score={/inv}";HPTS
6110 PTS=0:IF LL=9 THEN LTIM=20
6120 IF LL=26 THEN LTIM=70
6130 GOTO 9110
7000 FOR T=1 TO 10 STEP 2:SOUND 0,70-T,6,4:NEXT T:FOR T=1 TO 10:SOUND 0,50,6,4:NEXT T
7005 IF S=14 THEN Y=Y-1
7010 IF S=7 THEN X=X+1
7020 IF S=11 THEN X=X-1
7030 IF S=13 THEN Y=Y+1
7040 IF TP=7400 THEN TIME=TIME+3
7050 RETURN
7300 POSITION 1,11:? #6;"{inv}TIM LFT={/inv}";TIMEL;:? #6;" PTS=";PTS:RETURN
7400 POSITION 1,11:? #6;"{inv}TIME={/inv}";ADTIM:RETURN
7500 TIMEL=TIMEL-TIME:POSITION 10,11:? #6;" ":POSITION 9,11:? #6;TIMEL:IF TIMEL=0 THEN 6000
7510 RETURN
7600 ADTIM=ADTIM+TIME:POSITION 6,11:? #6;ADTIM:RETURN
8000 GNU=GNU+1:FOR T=1 TO 5:SOUND 1,30,10,8:NEXT T:SOUND 1,0,0,0:GOTO 4500
9000 GNU=NU:FOR L=1 TO LL
9010 NX=INT(18*RND(1))+1:NY=INT(9*RND(1))+1
9020 LOCATE NX,NY,NL
9030 IF NL<>32 THEN 9010
9040 POSITION NX,NY:? #6;CHR$(GNU):GNU=GNU+1:NEXT L:GNU=NU:RETURN
9100 GRAPHICS 18:POSITION 1,1:? #6;"{inv}TIME={/inv}";ADTIM:IF ADTIM<BTIM THEN BTIM=ADTIM
9105 IF BTIM=90000 THEN 9110
9107 POSITION 1,3:? #6;"{inv}best time={/inv}";BTIM
9110 POSITION 1,6:? #6;"push joystick for-":POSITION 1,7:? #6;"ward for SAME GAME."
9120 POSITION 1,9:? #6;"pull joystick back":POSITION 1,10:? #6;"for NEW GAME."
9125 IF STICK(0)<>15 THEN 9125
9130 IF STICK(0)=14 THEN 190
9140 IF STICK(0)=13 THEN 140
9150 GOTO 9130
9200 IF LL=9 THEN PTS=PTS+10+TIMEL:LTIM=LTIM-1:IF LTIM=8 THEN LTIM=9
9210 IF LL=26 THEN PTS=PTS+30+TIMEL:LTIM=LTIM-5:IF LTIM=30 THEN LTIM=35
9220 GOTO 190
9250 GRAPHICS 18:POSITION 5,2:? #6;"{inv}alpha run{/inv}":POSITION 9,5:? #6;"by":POSITION 4,8:? #6;"{inv}steve  groll{/inv}"
9260 POKE 756,STLL/256
9300 FOR T=1 TO 200:NEXT T:POSITION 0,2:? #6;CHR$(163):SOUND 2,255,6,2:FOR T=1 TO 150:NEXT T
9305 SOUND 2,70,6,4
9310 X=0:Y=2:FOR L=1 TO 4:POSITION X,Y:? #6;" ":X=X+1:POSITION X,Y:? #6;CHR$(163):FOR T=1 TO 30:NEXT T:NEXT L
9320 FOR L=1 TO 20:READ A,B:POSITION A,B:? #6;CHR$(92):FOR T=1 TO 7:SOUND 1,40,8,15:SOUND 2,30,8,15:NEXT T
9330 SOUND 1,0,0,0:SOUND 2,0,0,0:POSITION A,B:? #6;" ":NEXT L:RETURN
9510 DATA 24,90,126,90,24,219,255,219,224,238,68,255,255,68,238,224,7,119,34,255,255,34,119,7
9530 DATA 219,255,219,24,90,126,90,24
9540 DATA 60,126,255,255,255,255,126,60,146,84,40,149,40,84,146,17,255,255,255,255,255,255,255,255
9600 DATA 5,2,6,2,7,2,8,2,9,2,11,2,12,2,13,2,9,5,10,5,4,8,5,8,6,8,7,8,8,8,11,8,12,8,13,8,14,8,15,8
10000 DATA 4,3,4,8,7,4,7,6,11,4,11,6,9,8,9,2,15,3,15,8

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: ALPHARUN.BAS.

Credits