ZX81 Listing for cw.p


ZX81 program listing for **CAVE WAR**SLR/1985***

SYSTEM VARIABLES

PROG  : 16509
D-FILE: 17883
VARS  : 18676
E-LINE: 18677
STKBOT: 18677
STKEND: 18677


LEGEND

9999 means line number
PRINT means treat as KEYWORD P


PROGRAM LISTING

  10 REM **CAVE WAR**SLR/1985***
  20 LET S=0
  30 LET X=15
  40 LET A$="        "
  50 LET B$="                   
             "
  60 LET C$="                   
             "
  70 LET C=175
  80 LET A=12
  90 LET D$="PEEK (PEEK 16398+25
6*PEEK 16399)"
 100 FOR G=1 TO 200
 110 SCROLL
 120 PRINT AT 0,X;"H";AT 21,0;B$
AND G=C;C$ AND G>C;AT 21,A;A$
AND G<=C;
 130 LET X=X-(INKEY$="Z" AND X>0
)+(INKEY$="." AND X<31)
 140 LET A=A+(INT (RND*3-1))
 150 LET A=A+(A<0)-(A>24)
 160 PRINT AT 1,X;
 170 IF VAL D$=128 THEN GOTO 500
 180 LET S=S+1
 190 NEXT G
 200 SCROLL
 210 PRINT AT 0,X;"H";AT 21,0;B$
 220 LET G$="$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$"
 230 FOR G=20 TO 1 STEP -1
 240 FOR H=1 TO 5
 250 PRINT AT 0,0;C$;AT 0,X;"H";
AT G,1;G$
 260 LET X=X-(INKEY$="Z" AND X>1
)+(INKEY$="." AND X<30)
 270 IF INKEY$<>"X" THEN GOTO 30
0
 280 LET G$(X)=(" " AND G$(X)="$
")+("$" AND G$(X)=" ")
 290 LET S=S+(10 AND G$(X)=" ")
 300 NEXT H
 310 PRINT AT G,0;C$
 320 NEXT G
 330 LET H=0
 340 FOR G=1 TO 30
 350 IF G$(G)=" " THEN LET H=H+1
 360 NEXT G
 370 IF H<10 THEN GOTO 550
 380 LET A$=("      " AND A$="  
      ")+("        " AND A$="   
   ")
 390 LET S=S+(INT (RND*5*10))
 400 PRINT AT 21,A;A$
 410 GOTO 100
 500 SCROLL
 510 PRINT "SCORE IS ";S;" POINT
S..."
 520 SCROLL
 530 PRINT "YOU CRASHED AND DIED
...TOO BAD**"
 540 GOTO 610
 550 SCROLL
 560 PRINT "SCORE IS ";S;" POINT
S..."
 570 SCROLL
 580 PRINT "NOT ENOUGH HITS, YOU
,RE CRUSHED*"
 590 GOTO 610
 600 REM ******END OF GAME******
 610 PAUSE 4E4
 620 CLS
 630 RUN
 650 SAVE "CW"
 660 RUN