ZX81 Listing for wi.p


ZX81 program listing for **WATER BUG II*SLR/1984

SYSTEM VARIABLES

PROG  : 16509
D-FILE: 29018
VARS  : 29811
E-LINE: 29812
STKBOT: 29812
STKEND: 29812


LEGEND

9999 means line number
PRINT means treat as KEYWORD P


PROGRAM LISTING

  10 REM **WATER BUG II*SLR/1984
  20 GOTO 150
  30 LET C=X
  40 LET U=Y
  50 LET X=X-(INKEY$="7")+(
INKEY$="6")
  60 LET Y=Y-(INKEY$="5")+(
INKEY$="8")
  70 RETURN
  80 LET X=5
  90 LET Y=2
 100 LET C=X
 110 LET U=Y
 120 LET V=20
 130 LET I=20
 140 RETURN
 150 LET S=0
 160 CLS
 170 FOR L=5 TO 20
 180 PRINT AT L,0;" !!!!!!!!!!!!
!!!!!!!!!!!!!!!!!! ";AT 20,30;"$
";AT 21,0;"            BOARD 1  
           "
 190 NEXT L
 200 GOSUB 80
 210 LET L$=STR$ S
 220 PRINT AT 2,12;"SCORE:";L$;
AT X,Y;"O";AT C,U;"!" AND (X<>C
OR Y<>U);AT V,I;"*"
 230 GOSUB 30
 240 PRINT AT V,I;"!"
 250 IF RND>.5 THEN LET I=I-SGN
(I-Y)
 260 IF I=Y THEN LET V=V-SGN (V-
X)
 270 PRINT AT V,I;"*";AT X,Y;
 280 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
 290 IF L=141 THEN GOTO 330
 300 IF L<>8 AND L<>180 THEN
GOTO 4000
 310 LET S=S+1
 320 GOTO 210
 330 LET S=S+INT (RND*10*100)
 340 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE GOT THY TREASURE.HOR
AY ALL. "
 350 PAUSE 400
 360 RAND 0
 370 FOR L=1 TO 20
 380 PRINT AT INT (RND*19+SIN (L
*10)),INT (RND*29+COS (L/10));"º
"
 390 NEXT L
 400 CLS
 410 FOR L=1 TO 20
 420 PRINT AT 0,0;"             
                   ";AT 21,0;"  
          BOARD 2             ";
AT L,0;" !!!!!!!!!!!!!!!!!!!!!!!
!!!!!!! "
 430 NEXT L
 440 GOSUB 80
 450 LET Z=INT (20*RND+1)
 460 LET T=INT (30*RND+1)
 470 LET O=0
 480 PRINT AT X,Y;"O";AT C,U;"!"
AND (X<>C OR Y<>U);AT V,I;"*";
AT Z,T;"$" AND O=2
 490 GOSUB 30
 500 PRINT AT V,I;"!"
 510 IF RND>.5 THEN LET V=V-SGN
(V-X)
 520 IF RND>.5 THEN LET I=I-SGN
(I-Y)
 530 PRINT AT V,I;"*";AT X,Y;
 540 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
 550 IF L=141 THEN GOTO 610
 560 IF L<>8 AND L<>180 THEN
GOTO 4000
 570 IF X=Z AND Y=1 THEN LET O=2
AND O=1
 580 IF Y=T AND X=20 THEN LET O=
1
 590 LET S=S+1
 600 GOTO 480
 610 LET S=S+INT (RND*10*100)
 620 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE GOT THY TREASURE.HOR
AY ALL. "
 630 PAUSE 400
 640 FOR L=1 TO 20
 650 PRINT AT INT (RND*19+SIN (L
*10)),INT (RND*29+COS (L/10));"º
"
 660 NEXT L
 670 CLS
 680 FOR L=1 TO 20
 690 PRINT AT 0,0;"             
                   ";AT L,0;" !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!! ";
AT 21,0;"            BOARD 3    
         "
 700 NEXT L
 710 GOSUB 80
 720 FOR L=1 TO 25
 730 PRINT AT INT (RND*20+1),
INT (RND*30+1);" ";AT INT (RND*2
0+1),INT (RND*30+1);"-"
 740 NEXT L
 750 PRINT AT X,Y;"O";AT C,U;"!"
AND (X<>C OR Y<>U);AT V,I;"$"
 760 GOSUB 30
 770 PRINT AT V,I;"!"
 780 LET Z=V+(INT (3*RND-1))
 790 LET T=I+(INT (3*RND-1))
 800 PRINT AT Z,T;
 810 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
 820 IF L=150 THEN LET V=INT (20
*RND+1)
 830 IF L=150 THEN LET I=INT (30
*RND+1)
 840 IF L=8 THEN LET V=Z
 850 IF L=8 THEN LET I=T
 860 PRINT AT V,I;"$";AT X,Y;
 870 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
 880 IF L=141 THEN GOTO 920
 890 IF L<>8 AND L<>180 THEN
GOTO 4000
 900 LET S=S+1
 910 GOTO 750
 920 LET S=S+INT (RND*10*100)
 930 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE GOT THY TREASURE.HOR
AY ALL. "
 940 PAUSE 400
 950 FOR L=1 TO 20
 960 PRINT AT INT (RND*19+SIN (L
*10)),INT (RND*29+COS (L/10));"º
"
 970 NEXT L
 980 CLS
 990 FOR L=1 TO 20
1000 PRINT AT 0,0;"             
                   ";AT 21,0;"  
          BOARD 4             ";
AT L,0;" !!!!!!   !!!!!  !!!!!  
 !!!!!! ";AT 20,14;"-"
1010 NEXT L
1020 DIM A$(60)
1030 LET A$="!!!!!!!!!!   !!!!!!
!!!!!   !!!!!!!!!!!!!!!!   !!!!!
!!!!!!   "
1040 GOSUB 80
1045 LET I=25
1050 LET O=0
1060 PRINT AT 4,1;A$( TO 30);AT
18,1;A$(31 TO );AT X,Y;"O";AT C,
U;"!" AND (X<>C OR Y<>U);AT V,I;
"*" AND O=2;AT 1,20;"-" AND O=1;
AT 20,30;"$" AND O=2
1070 GOSUB 30
1080 LET A$=A$(2 TO )+A$(1)
1090 IF O<>2 THEN GOTO 1150
1100 PRINT AT V,I;"!"
1110 IF RND>.7 THEN LET V=V-SGN
(V-X)
1120 IF RND>.5 THEN LET I=I-SGN
(I-Y)
1130 IF I<25 THEN LET I=25
1140 PRINT AT V,I;"*"
1150 PRINT AT X,Y+(X=4 OR X=18);
1160 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
1170 IF L=141 THEN GOTO 1210
1180 IF L=150 THEN LET O=O+1
1190 IF L<>8 AND L<>180 AND L<>1
50 THEN GOTO 4000
1200 GOTO 1060
1210 LET S=S+INT (RND*10*100)
1220 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE GOT THY TREASURE.HOR
AY ALL. "
1230 PAUSE 400
1240 FOR L=1 TO 20
1250 PRINT AT INT (RND*19+SIN (L
*10)),INT (RND*29+COS (L/10));"º
"
1260 NEXT L
1270 CLS
1280 FOR L=1 TO 20
1290 PRINT AT 0,0;"             
                   ";AT 21,0;"  
          BOARD 5             ";
AT L,0;" !!!!!!!!    !!!!!!!!!!!
!!!!!!! " AND L<11;" !!!!!!!!!!!
!!!!!!!    !!!!!!!! " AND L>10
1300 NEXT L
1310 DIM A$(320)
1320 FOR L=0 TO 9
1330 LET A$(L*32+1 TO L*32+32)="
 !!!!!!!!!!!!    !!!!!!!!!!!!!! 
"
1340 NEXT L
1350 FOR L=1 TO 25
1360 PRINT AT 6,0;A$;AT 20,30;"-
"
1370 LET A$(INT (RND*10)*32+1+
INT (RND*30+1))="º"
1380 NEXT L
1390 GOSUB 80
1400 LET Z=INT (RND*10)*32+1+
INT (RND*12+1)
1410 PRINT AT 6,0;A$;AT X,Y;"O";
AT C,U;"!" AND (X<>C OR U<>Y)
1420 LET A$=A$(33 TO )+A$( TO 32
)
1430 GOSUB 30
1440 PRINT AT X,Y;
1450 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
1460 IF L=141 THEN GOTO 1550
1470 IF L=150 THEN LET A$(Z)="$"
1480 IF L<>8 AND L<>180 AND L<>1
50 THEN GOTO 4000
1490 IF X<6 OR X>16 THEN GOTO 14
10
1500 PRINT AT X+1,Y;
1510 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
1520 IF L=141 THEN GOTO 1550
1530 IF L<>8 AND L<>180 THEN
GOTO 4000
1540 GOTO 1410
1550 LET S=S+INT (RND*10*100)
1560 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE GOT THY TREASURE.HOR
AY ALL. "
1570 PAUSE 400
1580 FOR L=1 TO 20
1590 PRINT AT INT (RND*19+SIN (L
*10)),INT (RND*29+COS (L/10));"º
"
1600 NEXT L
1610 CLS
1620 FOR L=1 TO 20
1630 PRINT AT 0,0;"             
                   ";AT 21,0;"  
          BOARD 6             ";
AT L,0;" !!!!!!!!!!!!!    !!!!!!
!!!!!!! "
1650 IF L>4 AND L<9 THEN PRINT
AT L,16-L;"                    "
( TO L+L)
1660 IF L>12 AND L<17 THEN
PRINT AT L,L-5;"                
    "(L-10 TO 31-L)
1670 NEXT L
1680 DIM A$(120)
1690 LET A$="!!  !! ! !! !! !! !
 !! !! ! !! !  ! !!! !! !! !!   
 ! ! !!!  !! !!  !!  !!!!  !! ! 
!!     !!! !!! !!! ! !!!  !! !! 
 !!! "
1700 GOSUB 80
1800 LET Z=INT (RND*2+1)*30+1+
INT (RND*30)
1810 LET O=0
1820 PRINT AT 20,1;"-"
1830 PRINT AT 9,1;A$( TO 30);AT
10,1;A$(31 TO 60);AT 11,1;A$(61
TO 90);AT 12,1;A$(91 TO );AT X,
Y;"O";AT C,U;"!" AND (X<>C OR Y
<>U);AT 1,30;"-" AND O=1;AT 20,3
0;"-" AND O=2
1840 GOSUB 30
1850 LET A$=A$(2 TO 30)+A$(1)+A$
(60)+A$(31 TO 59)+A$(62 TO 90)+A
$(61)+A$(120)+A$(91 TO 119)
1860 PRINT AT X,Y+(X=9 OR X=11)-
(X=10 OR X=12);
1870 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
1880 IF L=141 THEN GOTO 1940
1890 IF L=150 THEN LET O=O+1
1900 IF O=3 THEN LET A$(Z)="$"
1910 IF O=3 THEN LET O=4
1920 IF L<>8 AND L<>180 AND L<>1
50 THEN GOTO 4000
1930 GOTO 1830
1940 LET S=S+INT (RND*10*100)
1950 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE GOT THY TREASURE.HOR
AY ALL. "
1960 PAUSE 400
1970 FOR L=1 TO 20
1980 PRINT AT INT (RND*19+SIN (L
*10)),INT (RND*29+COS (L/10));"º
"
1990 NEXT L
2000 CLS
2010 FOR L=1 TO 20
2020 PRINT AT 0,0;"             
                   ";AT 21,0;"  
          BOARD 7             ";
AT L,0;"  !!!  !!!  !!!  !!!  !!
!  !!!  " AND L/2=INT (L/2);" !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!! "
AND L/2<>INT (L/2)
2030 NEXT L
2040 GOSUB 80
2050 DIM A$(1)
2060 LET A$="-"
2070 LET Z=0
2080 LET T=Z
2090 PRINT AT X,Y;"O";AT C,U;"!"
AND (X<>C OR Y<>U);AT V,I;A$
2100 GOSUB 30
2110 PRINT AT V,I;"!"
2120 LET Z=V+INT (RND*3-1)
2130 LET T=I+INT (RND*3-1)
2140 PRINT AT Z,T;
2150 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
2160 IF L=8 THEN LET V=Z
2170 IF L=8 THEN LET I=T
2180 PRINT AT V,I;A$;AT X,Y;
2190 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
2200 IF L=141 THEN GOTO 2290
2210 IF L=150 THEN GOSUB 2240
2220 IF L<>8 AND L<>180 AND L<>1
50 THEN GOTO 4000
2230 GOTO 2090
2240 LET A$="$"
2250 PRINT AT V,I;"!"
2260 LET V=INT (RND*20+1)
2270 LET I=INT (RND*30+1)
2280 RETURN
2290 LET S=S+INT (RND*10*100)
2300 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE GOT THY TREASURE.HOR
AY ALL. "
2310 PAUSE 400
2320 FOR L=1 TO 20
2330 PRINT AT INT (RND*19+SIN (L
*10)),INT (RND*29+COS (L/10));"º
"
2340 NEXT L
2350 CLS
2360 FOR L=1 TO 20
2370 PRINT AT 0,0;"             
                   ";AT 21,0;"  
          BOARD 8             ";
AT L,0;" !!!!!!    !!!!!!!!!!   
 !!!!!! " AND (L<3 OR L>18);" !!
!!!!!!!!!        !!!!!!!!!!! "
AND (L>2 AND L<19)
2380 NEXT L
2390 GOSUB 80
2400 DIM A$(50)
2410 LET A$="!!!! !! !!!! !! !!!
!! ! !  ! !! !!!!!!!!!!!! !! !!"
2420 PRINT AT 20,1;"-";AT 10,0;"
                    !!!!!!!!!!! 
                    !!!!!!!!!!! 
"
2430 PRINT AT 1,11;A$( TO 10);
AT 2,11;A$(11 TO 20);AT 19,11;A$
(31 TO 40);AT 20,11;A$(41 TO );
AT X,Y;"O";AT C,U;"!" AND (X<>C
OR Y<>U)
2440 GOSUB 30
2450 PRINT AT X+(X<3 OR X=19),Y;
2460 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
2470 IF L=141 THEN GOTO 2520
2480 IF L=150 THEN PRINT AT 1,1;
"$"
2490 IF L<>8 AND L<>180 AND L<>1
50 THEN GOTO 4000
2500 LET A$=A$(11 TO )+A$( TO 10
)
2510 GOTO 2430
2520 LET S=S+INT (RND*10*100)
2530 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE GOT THY TREASURE.HOR
AY ALL. "
2540 PAUSE 400
2550 FOR L=1 TO 20
2560 PRINT AT INT (RND*19+SIN (L
*10)),INT (RND*29+COS (L/10));"º
"
2570 NEXT L
2580 CLS
2590 FOR L=1 TO 20
2600 PRINT AT 0,0;"             
                   ";AT 21,0;"  
          BOARD 9             ";
AT L,0;" !!!!!!!!!!!!!!!!!!!!!!!
!!!!!!! "
2610 NEXT L
2620 DIM A$(1)
2630 LET A$="*"
2640 GOSUB 80
2650 PRINT AT 20,30;"-"
2660 LET O=0
2670 LET Z=INT (RND*20+1)
2680 LET T=INT (RND*30+1)
2690 PRINT AT X,Y;"O";AT C,U;"!"
AND (X<>C OR Y<>U);AT V,I;A$;
AT Z,T;"$" AND O
2700 GOSUB 30
2710 PRINT AT V,I;"!"
2720 IF RND>.5 THEN LET V=V-SGN
(V-X)
2730 IF RND>.5 THEN LET I=I-SGN
(I-Y)
2740 PRINT AT V,I;A$;AT X,Y;
2750 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
2760 IF L=141 THEN GOTO 2820
2770 IF L=150 THEN LET A$="$"
2780 IF L=13 THEN LET O=1
2790 IF L=13 THEN LET A$="*"
2800 IF L<>8 AND L<>180 AND L<>1
50 AND L<>13 THEN GOTO 4000
2810 GOTO 2690
2820 LET S=S+INT (RND*10*100)
2830 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE GOT THY TREASURE.HOR
AY ALL. "
2840 PAUSE 400
2850 FOR L=1 TO 20
2860 PRINT AT INT (RND*19+SIN (L
*10?),INT (RND*29+COS (L/10));"º
"
2870 NEXT L
2880 CLS
2890 FOR L=1 TO 20
2900 PRINT AT 0,0;"             
                   ";AT 21,0;"  
          BOARD 10            ";
AT L,0;"  !!    !!!!   !!   !!!!
    !!  " AND ((L/2=INT (L/2)
AND L<11) OR (L/2<>INT (L/2)
AND L>10));" !!!!!!!!!!!!!!!!!!
!!!!!!!!!!!! " AND ((L/2<>INT (L
/2) AND L<10) OR (L/2=INT (L/2)
AND L>11))
2910 NEXT L
2920 GOSUB 80
2930 DIM A$(60)
2940 LET A$=" !! ! !!  ! ! !  !!
!  !! !     !! ! !!!!  ! !!! ! !
!! !  !! "
2950 PRINT AT 20,30;"-"
2960 LET Z=8
2970 PRINT AT 7,?;A$( TO 30);AT
14,1;A$(31 TO );AT X,Y;"O";AT C,
U;"!" AND (X<>C OR Y<>U);AT V,I;
"*"
2975 LET A$=A$(2 TO )+A$(1)
2980 GOSUB 30
2990 PRINT AT V,I;Z
3000 IF RND>.6 THEN LET V=V-SGN
(V-X)
3010 IF RND>.6 THEN LET I=I-SGN
(I-Y)
3020 PRINT AT V,I;
3030 LET Z=PEEK (PEEK 16398+256*
PEEK 16399)
3040 PRINT "*";AT X,Y+(X=7 OR X=
14);
3050 LET L=PEEK (PEEK 16398+256*
PEEK 16399)
3060 IF L=141 THEN GOTO 3100
3070 IF L=150 THEN PRINT AT 1,1;
"$"
3080 IF L<>8 AND L<>180 AND L<>1
50 THEN GOTO 4000
3090 GOTO 2970
3100 LET S=S+INT (RND*5*1000)
3110 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE GOT THY TREASURE.HOR
AY ALL. "
3120 PAUSE 200
3130 PRINT AT 10,0;" YEE COMPLET
ED ALL TEN BOARDS*** YEE RECIEVE
 SPECIAL BONUS AND   GAIN THY SP
ECIAL TITLE OF - - - W A T E R  
B U G  M A S T E R  ºººººººººººº
ºººººººººººººººººººº"
3140 PAUSE 500
3150 FOR L=1 TO 25
3160 PRINT AT INT (RND*19+SIN (L
*10)),INT (RND*29+COS (L/10));"º
"
3170 NEXT L
3180 CLS
3190 GOTO 160
3200 CLEAR
3210 SAVE "WI"
3220 PRINT AT 4,3;"õ    µ       
µ÷ó  óõ            òôµõ·ñµ³õ    
µ÷   ÷ñ             µõµõ õ µ    
µ²³  ò³";AT 9,2;"       ÷´ô     
·óó               ²¶    ²±ñ     
 ·³               ³·±   ÷ó´ ò ñ 
´³±               ²²    ²³ö     
         ";TAB 23;"   ";TAB 23;"
   ";TAB 22;"     "
3230 LET B$="    ö·÷¶òô ± ±´ ö¶ 
·õ    ÷²µ õ·     õµõ  õ µ ò´ ö¶·
²²    ÷¶         ¶ò²ö·ñ ±ô µ ¶ö 
 õ    ²±   ò                    
                 öó ´÷µóµ õ÷ñ²µ 
 ÷²µóò ñ÷²       ó´ µõµñµ õ÷    
  ñµñ   õµ       ²± µõµ³   ²ôõ´ 
 õ¶µ³· ô²÷                      
             "
3240 PRINT AT 17,0;B$( TO 128)
3250 FOR L=1 TO 25
3260 IF INKEY$<>"" THEN RUN
3270 NEXT L
3280 FOR L=1 TO 4
3290 LET B$=B$(33 TO )+B$( TO 32
)
3300 PRINT AT 17,0;B$( TO 128)
3310 FOR S=1 TO 2
3320 IF INKEY$<>"" THEN RUN
3330 NEXT S
3340 NEXT L
3350 FOR L=1 TO 25
3360 IF INKEY$<>"" THEN RUN
3370 NEXT L
3380 GOTO 3230
4000 PRINT AT 2,12;"SCORE:";S;
AT 4,0;"YEE DIED***PRESS ENTER T
O BEGIN."
4010 PAUSE 4E4
4020 RUN