mirror of
https://github.com/inexorabletash/jsbasic.git
synced 2024-11-30 01:49:29 +00:00
112 lines
2.5 KiB
Plaintext
112 lines
2.5 KiB
Plaintext
100 PRINT "THIS IS THE GAME OF CHASE"
|
|
110 PRINT "WANT INSTRUCTIONS";
|
|
120 INPUT C$
|
|
130 IF LEFT$(C$,1)="N" THEN 230
|
|
140 IF LEFT$(C$,1)<>"Y" THEN 110
|
|
150 PRINT "YOU ARE '*' IN A HIGH VOLTAGE MAZE WITH 5"
|
|
160 PRINT "SECURITY MACHINES '+' TRYING TO DESTROY YOU"
|
|
170 PRINT "YOU MUST MANEUVER THE SECURITY MACHINES INTO"
|
|
180 PRINT "THE MAZE 'X' TO SURVIVE. GOOD LUCK !!!"
|
|
190 PRINT "MOVES ARE 7,8,9"
|
|
200 PRINT " 4,5,6"
|
|
210 PRINT " 1,2,3 0 TO END THE GAME"
|
|
220 PRINT
|
|
230 DIM A(10,20),E(21),F(21)
|
|
240 LET G=0
|
|
250 FOR B=1 TO 10
|
|
260 FOR C=1 TO 20
|
|
270 LET A(B,C)=0
|
|
280 IF B=1 THEN 330
|
|
290 IF B=10 THEN 330
|
|
300 IF C=1 THEN 330
|
|
310 IF C=20 THEN 330
|
|
320 GOTO 340
|
|
330 LET A(B,C)=1
|
|
340 NEXT C
|
|
350 NEXT B
|
|
360 FOR D=1 TO 21
|
|
370 LET B=INT(RND(1)*8)+2
|
|
380 LET C=INT(RND(1)*18)+2
|
|
390 IF A(B,C)<>0 THEN 370
|
|
400 LET A(B,C)=1
|
|
410 IF D<6 THEN 430
|
|
420 GOTO 440
|
|
430 LET A(B,C)=2
|
|
440 IF D=6 THEN 460
|
|
450 GOTO 470
|
|
460 LET A(B,C)=3
|
|
470 LET E(D)=B
|
|
480 LET F(D)=C
|
|
490 NEXT D
|
|
500 FOR B=1 TO 10
|
|
510 FOR C=1 TO 20
|
|
520 IF A(B,C)<>0 THEN 550
|
|
530 PRINT " ";
|
|
540 GOTO 630
|
|
550 IF A(B,C)<>1 THEN 580
|
|
560 PRINT "X";
|
|
570 GOTO 630
|
|
580 IF A(B,C)<>2 THEN 610
|
|
590 PRINT "+";
|
|
600 GOTO 630
|
|
610 IF A(B,C)<>3 THEN 630
|
|
620 PRINT "*";
|
|
630 NEXT C
|
|
640 PRINT
|
|
650 NEXT B
|
|
660 LET B=E(6)
|
|
670 LET C=F(6)
|
|
680 LET A(B,C)=0
|
|
690 INPUT Y
|
|
700 ON Y+1 GOTO 1040,730,730,730,740,780,740,710,710,710
|
|
710 LET B=B-1
|
|
720 GOTO 740
|
|
730 LET B=B+1
|
|
740 ON Y GOTO 750,780,770,750,780,770,750,780,770
|
|
750 LET C=C-1
|
|
760 GOTO 780
|
|
770 LET C=C+1
|
|
780 IF A(B,C)=1 THEN 1060
|
|
790 IF A(B,C)=2 THEN 1080
|
|
800 LET A(B,C)=3
|
|
810 LET E(6)=B
|
|
820 LET F(6)=C
|
|
830 FOR D=1 TO 5
|
|
840 IF A(E(D),F(D))<>2 THEN 1020
|
|
850 LET A(E(D),F(D))=0
|
|
860 IF E(D)>=B THEN 890
|
|
870 LET E(D)=E(D)+1
|
|
880 GOTO 910
|
|
890 IF E(D)=B THEN 910
|
|
900 LET E(D)=E(D)-1
|
|
910 IF F(D)>=C THEN 940
|
|
920 LET F(D)=F(D)+1
|
|
930 GOTO 960
|
|
940 IF F(D)=C THEN 960
|
|
950 LET F(D)=F(D)-1
|
|
960 IF A(E(D),F(D))=3 THEN 1080
|
|
970 IF A(E(D),F(D))=0 THEN 1000
|
|
980 LET G=G+1
|
|
990 GOTO 1010
|
|
1000 LET A(E(D),F(D))=2
|
|
1010 IF G=5 THEN 1100
|
|
1020 NEXT D
|
|
1030 GOTO 500
|
|
1040 PRINT "SORRY TO SEE YOU QUIT"
|
|
1050 GOTO 1110
|
|
1060 PRINT "ZAP!!! YOU TOUCHED THE FENCE !!!!!"
|
|
1070 GOTO 1110
|
|
1080 PRINT "** YOU HAVE BEEN DESTROYED BY A LUCKY COMPUTER **"
|
|
1090 GOTO 1110
|
|
1100 PRINT "YOU ARE LUCKY **YOU DESTROYED ALL THE ENEMY**"
|
|
1110 PRINT "WANT TO PLAY AGAIN";
|
|
1120 INPUT C$
|
|
1130 IF LEFT$(C$,1)="Y" THEN 240
|
|
1140 IF LEFT$(C$,1)<>"N" THEN 1110
|
|
1150 PRINT "HOPE YOU DON'T FEEL FENCED IN."
|
|
1160 PRINT "TRY AGAIN SOMETIME"
|
|
1170 END
|
|
1140 IF LEFT$(C$,1)<>"N" THEN 1110
|
|
1150 PRINT "HOPE YOU DON'T FEEL FENCED IN."
|
|
1160 PRINT "TRY AGAIN SOMET
|