ZX81 Programs


Read about, play, run, or list games, animations, and more. These are my programs from the ’80s to today.

ZX81 Program Listing

SPACE LANDER 2011 (slander2.p)


SYSTEM VARIABLES

PROG  : 16509
D-FILE: 17878
VARS  : 18671
E-LINE: 18718
STKBOT: 18718
STKEND: 18718


LEGEND

A means INVERSE A
A means GRAPHICS A
PRINT means treat as KEYWORD P


PROGRAM LISTING

  10 REM * SPACE  LANDER *
  20 REM "*SLR, 1983, 2011*"
  30 PRINT ,,"**SPACE LANDER**",
,,"Z FOR LEFT, X FOR RIGHT, . TO
   LAND"
  40 GOSUB 800
  50 LET A=INT (32*RND)
  60 LET S=0
  80 LET C=3
  90 REM ** MAIN LOOP
 100 REM **** MOVE CRAFT
 110 GOSUB 200
 120 REM **** LAND CRAFT
 130 GOSUB 300
 140 REM **** CONTINUE?
 150 GOSUB 600
 160 IF C THEN GOTO 100
 170 REM **** GAME OVER
 180 GOSUB 700
 190 RUN
 200 REM *** MOVE CRAFT ROUTINE
 210 SCROLL
 220 PRINT TAB A;"X"
 230 LET B$=INKEY$
 240 IF B$="." THEN RETURN
 250 LET A=A-(B$="Z" AND A>0)+(B
$="X" AND A<31)
 260 GOTO 210
 300 REM *** LAND CRAFT ROUTINE
 310 LET L=INT (26*RND)
 320 CLS
 330 PRINT AT 11,0;"<><><><><><>
<><><><><><><><><><>";AT 11,L;"-
-----"
 340 PAUSE 30
 350 REM ** ATTEMPT LOOP
 360 FOR T=0 TO 9
 370 PRINT AT T,A;"X"
 380 LET B$=INKEY$
 390 LET A=A-(B$="Z" AND A>0)+(B
$="X" AND A<31)
 400 NEXT T
 410 REM * DID WE HIT?
 420 IF A>=L AND A<=(L+6) THEN
GOTO 500
 430 REM ** NOPE
 440 LET C=C-1
 450 PRINT AT 10,A;"D";AT 12,0;"
CRASH****",,"LANDER DESTROYED**/
/**"
 460 RETURN
 500 REM ** YEP
 510 LET S=S+100
 520 PRINT AT 10,A;"X";AT 12,0;"
LAND****",,"LANDER MADE IT***//*
**"
 530 RETURN
 600 REM *** CONTINUE ROUTINE
 610 PRINT AT 15,0;"SCORE = ";S;
TAB 0;"LIVES LEFT = ";C
 620 GOSUB 800
 630 RETURN
 700 REM *** GAME OVER ROUTINE
 710 CLS
 720 PRINT ,,"**SPACE LANDER**",
,,"****GAME OVER****",,,"YOU SCO
RED ";S;" POINTS**"
 730 GOSUB 800
 740 CLS
 750 RETURN
 800 REM *** CONTINUE ROUTINE
 810 PRINT ,,"PRESS ANY KEY TO C
ONTINUE..."
 820 PAUSE 4E4
 830 RETURN
 900 SAVE "SLANDER2"
 910 RUN