Ever since seeing the Artillery game in the March/April issue of SYNC, I have been interested in devising a way for the player to see the projectile on its flight to the target, using the 8K ROM, of course. It would be an easy project with lots of RAM, but it was not that easy when limited to 1K RAM. After rewriting much of the program to save space and eliminating a few features such as keeping track of the number of shells fired, I was finally able to make it work.
To play the game, RUN the program. Make your first shot by ENTERing any angle of elevation between 0 and 90 degrees. At the higher angles, you will see the shell arch way up before falling back to the ground, much like a mortar shell being “lobbed” toward its target. Continue firing until you get a direct hit. Then the game is over. You can count your shots from the shell holes in the display. Hit RUN to start over.
A few notes will make the program clearer:
1) Listing 2: l. 12, INPUT is a key word.
2) Listing 2: If you encounter memory problems, omit lines 1, 2, 12, 38, but you must remember what the game calls for without the screen prompts.
3) Listing 2: l. 38, Direct hit must be followed by 5 spaces and the ” mark.
4) Both versions: 8, inverse 0, 30 graphic D
32, asterisk
36, inverse asterisk is a hit.
5) Both versions show the projectile; the ZX80 by a PAUSE routine, and the ZX81 by the SLOW mode.
Program adapted to ZX81 by David Grosjean.
Listing 1. ZX80 8K ROM
1 REM ZX80
2 REM "ARTILLERY""
4 LET A=10+INT (RND*20)
6 PRINT "RANGE=";A;"000 YDS"
8 PRINT AT 17,0;"[inv 0]▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒"
10 PRINT AT 17,A;"T"
14 INPUT N
16 LET B=N
18 IF N>45 THEN LET N=90-N
20 LET L=INT (N*.68)
22 FOR I=1 TO 2*L-1
24 LET J=10+B/3*SIN (1.57*I/L)
25 PLOT I,J
26 PAUSE 20
27 POKE 16437,255
28 UNPLOT I,J
30 NEXT I
32 PRINT AT 17,L;"*"
34 IF A<>L THEN GOTO 14
36 PRINT AT 17,L;"[inv *]"
Listing 2. ZX81 SLOW Mode
1 REM ZX81
2 REM "ARTILLERY""
4 LET A=10+INT (RND*20)
6 PRINT "RANGE=";A;"000 YDS"
8 PRINT AT 17,0;"[inv 0]▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒"
10 PRINT AT 17,A;"T"
12 PRINT " INPUT ELEVATION"
14 INPUT N
16 LET B=N
18 IF N>45 THEN LET N=90-N
20 LET L=INT (N*.68)
22 FOR I=1 TO 2*L-1
24 LET J=10+B/3*SIN (1.57*I/L)
25 PLOT I,J
28 UNPLOT I,J
30 NEXT I
32 PRINT AT 17,L;"*"
34 IF A<>L THEN GOTO 14
36 PRINT AT 17,L;"[inv *]"
38 PRINT "DIRECT HIT "
Sample Run

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.