ZX81 Programs


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

ZX81 Program Listing

**LOCK FIRE**SLR/1985 (lf.p)


SYSTEM VARIABLES

PROG  : 16509
D-FILE: 19715
VARS  : 20508
E-LINE: 20509
STKBOT: 20509
STKEND: 20509


LEGEND

9999 means line number
PRINT means treat as KEYWORD P


PROGRAM LISTING

  10 REM **LOCK £ FIRE**SLR/1985
  20 LET S=0
  30 LET L=1
  40 LET R=10
  50 DIM A$(2,3)
  60 DIM Z(2)
  70 DIM B(2,2)
  80 LET X=10
  90 LET Y=14
 100 LET X1=X
 110 LET Y1=Y
 120 CLS
 130 FOR A=0 TO 21
 140 PRINT AT A,0;"!!!!!";TAB 27
;"!!!!!";AT 20,5;"³³³   ³³±    ²
³³   ³³³";AT 21,5;"             
         "
 150 NEXT A
 160 LET C=R
 170 LET H=0
 180 LET B(1,1)=8
 190 LET B(1,2)=10
 200 LET B(2,1)=12
 210 LET B(2,2)=19
 220 LET A$(1)="¹:¹"
 230 LET A$(2)="ùUù"
 240 FOR G=1 TO 10+(2*(25 AND L>
25))+(2*(L AND L<26))
 250 PRINT AT X1,Y1;"     " AND
(X1<>X OR Y1<>Y);AT B(1,1),B(1,2
);A$(Z(1)+1);AT B(2,1),B(2,2);A$
(Z(2)+1);AT X,Y;">";AT X,Y+3;"<"
 255 LET S=S+1
 260 LET C=C-1
 270 IF C<=0 THEN GOSUB 500
 280 LET L$=INKEY$
 290 IF L$="L" THEN GOTO 620
 300 LET X1=X
 310 LET Y1=Y
 320 LET X=X-(L$="M" AND X>1)+(L
$="X" AND X<18)
 330 LET Y=Y-(L$="Z" AND Y>6)+(L
$="." AND Y<22)
 340 FOR V=1 TO 2
 350 PRINT AT B(V,1),B(V,2);"   
"
 360 LET V1=INT (RND*3-1)
 370 LET B(V,1)=B(V,1)+(V1 AND (
B(V,1)<2 AND V1>-1))+(V1 AND (B(
V,1)>16 AND V1<1))+(V1 AND (B(V,
1)>1 AND B(V,1)<17))
 380 LET V1=INT (RND*3-1)
 390 LET B(V,2)=B(V,2)+(V1 AND (
B(V,2)<6 AND V1>-1))+(V1 AND (B(
V,2)>23 AND V1<1))+(V1 AND (B(V,
2)>5 AND B(V,2)<24))
 400 NEXT V
 410 GOTO 250
 420 PRINT AT 12,0;"YOU MADE IT.
..SCORE=";S;TAB 0;"FOR LEVEL ";L
 430 PAUSE 100
 440 LET L=L+1
 450 LET R=R-(.1 AND R>2)
 460 GOTO 80
 500 LET C=R
 510 LET V1=INT (RND*2+1)
 520 FOR V=B(V1,1)+1 TO 21
 530 PRINT AT V,B(V1,2)+1;
 540 IF PEEK (PEEK 16398+256*
PEEK 16399)>0 AND V>19 THEN
GOTO 570
 550 PRINT "*";AT V-1,B(V1,2)+1;
" " AND V>B(V1,1)+1
 560 NEXT V
 570 PRINT " " AND V<22;AT V-1,B
(V1,2)+1;" " AND V>B(V1,1)+1
 580 LET H=H+1
 590 IF H>20 THEN GOTO 800
 600 IF V>21 THEN GOTO 800
 610 RETURN
 620 PRINT AT X-1,Y-1;"!";AT X+1
,Y-1;"!";AT X-1,Y+4;"!";AT X+1,Y
+4;"!"
 630 FOR V=1 TO 20
 640 IF INKEY$="F" THEN GOTO 680
 650 NEXT V
 660 GOSUB 500
 670 GOTO 630
 680 PRINT AT X,Y+1;
 690 LET P=PEEK (PEEK 16398+256*
PEEK 16399)
 700 PRINT AT X,Y+2;
 710 LET P1=PEEK (PEEK 16398+256
*PEEK 16399)
 720 PRINT AT X,Y+1;"  ";AT X,Y+
1;"²±";AT X,Y+1;"÷´";AT X,Y+1;"³
³";AT X,Y+1;"óó";AT X,Y+1;"ô·";
AT X,Y+1;"ñò";AT X,Y+1;"..";AT X
,Y+1;"  "
 730 IF P<>0 OR P1<>0 THEN GOTO
760
 740 PRINT AT X-1,Y-1;" ";AT X+1
,Y-1;" ";AT X-1,Y+4;" ";AT X+1,Y
+4;" "
 750 GOTO 250
 760 LET S=S+(10 AND P<>0)+(10
AND P1<>0)
 762 PRINT AT X-1,Y-1;" ";AT X+1
,Y-1;" ";AT X-1,Y+4;" ";AT X+1,Y
+4;" "
 764 LET Z(INT (RND*2+1))=INT (
RND*2)
 770 IF G=10 OR G=20 OR G=30 OR
G=40 OR G=50 THEN PRINT AT 21,5;
"                      "
 780 NEXT G
 790 GOTO 420
 800 PRINT AT 12,0;"YOU WERE KIL
LED...SCORE:";S;TAB 0;"TO THE LE
VEL OF ";L
 810 PRINT AT 17,0;"PRESS ENTER 
FOR A NEW GAME..."
 820 PAUSE 4E4
 830 RUN
 840 SAVE "LF"
 850 GOTO 810