diff --git a/dec/CHOMP.BAS b/dec/CHOMP.BAS new file mode 100644 index 0000000..180f4d1 --- /dev/null +++ b/dec/CHOMP.BAS @@ -0,0 +1,101 @@ +100 REM ***THE GAME OF CHOMP*** +105 REM ***SUBMITTED BY PEOPLES COMPUTER CENTER*** +110 PRINT +120 PRINT "THIS IS THE GAME OF CHOMP (SCIENTIFIC AMERICAN, JAN 1973)" +130 PRINT "WANT THE RULES (1=YES, 0=NO!)"; +140 INPUT R +150 IF R=0 THEN 340 +160 F=1 +170 R=5 +180 C=7 +190 PRINT "CHOMP IS FOR 1 OR MORE PLAYERS (HUMANS ONLY)." +200 PRINT +210 PRINT "HERE'S HOW A BOARD LOOKS (THIS ONE IS 5 BY 7):" +220 GOSUB 540 +230 PRINT +240 PRINT "THE BOARD IS A BIG COOKIE - R ROWS HIGH AND C COLUMNS" +250 PRINT "WIDE. YOU INPUT R AND C AT THE START. IN THE UPPER LEFT" +260 PRINT "CORNER OF THE COOKIE IS A POISON SQUARE (P). THE ONE WHO" +270 PRINT "CHOMPS THE POISON SQUARE LOSES. TO TAKE A CHOMP, TYPE THE" +280 PRINT "ROW AND COLUMN OF ONE OF THE SQUARES ON THE COOKIE." +290 PRINT "ALL OF THE SQUARES BELOW AND TO THE RIGHT OF THAT SQUARE" +300 PRINT "(INCLUDING THAT SQUARE, TOO) DISAPPEAR -- CHOMP!!" +310 PRINT "NO FAIR CHOMPING SQUARES THAT HAVE ALREADY BEEN CHOMPED," +320 PRINT "OR THAT ARE OUTSIDE THE ORIGINAL DIMENSIONS OF THE COOKIE." +330 PRINT +340 PRINT "HERE WE GO..." +350 DIM A(10,10) +360 F=0 +370 FOR I=1 TO 10 +372 FOR J=1 TO 10 +375 A(I,J)=0 +377 NEXT J +379 NEXT I +380 PRINT +390 PRINT "HOW MANY PLAYERS"; +400 INPUT P +410 I1=0 +420 PRINT "HOW MANY ROWS"; +430 INPUT R +440 IF R <= 9 THEN 470 +450 PRINT "TOO MANY ROWS (9 IS MAXIMUM). NOW, "; +460 GOTO 420 +470 PRINT "HOW MANY COLUMNS"; +480 INPUT C +490 IF C <= 9 THEN 530 +500 PRINT "TOO MANY COLUMNS (9 IS MAXIMUM). NOW, "; +510 GOTO 470 +530 PRINT +540 FOR I=1 TO R +550 FOR J=1 TO C +560 A(I,J)=1 +570 NEXT J +580 NEXT I +590 A(1,1)=-1 +600 REM PRINT THE BOARD +610 PRINT +620 PRINT TAB(7);"1 2 3 4 5 6 7 8 9" +630 FOR I=1 TO R +640 PRINT I;TAB(7); +650 FOR J=1 TO C +660 IF A(I,J)=-1 THEN 700 +670 IF A(I,J)=0 THEN 720 +680 PRINT "* "; +690 GOTO 710 +700 PRINT "P "; +710 NEXT J +720 PRINT +730 NEXT I +740 PRINT +750 IF F=0 THEN 770 +760 RETURN +770 REM GET CHOMPS FOR EACH PLAYER IN TURN +780 LET I1=I1+1 +790 LET P1=I1-INT(I1/P)*P +800 IF P1 <> 0 THEN 820 +810 P1=P +820 PRINT "PLAYER";P1 +830 PRINT "COORDINATES OF CHOMP (ROW,COLUMN)"; +840 INPUT R1,C1 +850 IF R1<1 THEN 920 +860 IF R1>R THEN 920 +870 IF C1<1 THEN 920 +880 IF C1>C THEN 920 +890 IF A(R1,C1)=0 THEN 920 +900 IF A(R1,C1)=-1 THEN 1010 +910 GOTO 940 +920 PRINT "NO FAIR. YOU'RE TRYING TO CHOMP ON EMPTY SPACE!" +930 GOTO 820 +940 FOR I=R1 TO R +950 FOR J=C1 TO C +960 A(I,J)=0 +970 NEXT J +980 NEXT I +990 GOTO 610 +1000 REM END OF GAME DETECTED IN LINE 900 +1010 PRINT "YOU LOSE, PLAYER ";P1 +1020 PRINT +1030 PRINT "AGAIN (1=YES, 0=NO!)"; +1040 INPUT R +1050 IF R=1 THEN 340 +1060 END diff --git a/dec/PIZZA.BAS b/dec/PIZZA.BAS new file mode 100644 index 0000000..d3d23dd --- /dev/null +++ b/dec/PIZZA.BAS @@ -0,0 +1,65 @@ +10 DIM A$(26),S$(16),N$(4),A(10),M$(4) +20 RANDOMIZE +30 PRINT "PIZZA DELIVERY GAME":PRINT +50 INPUT "WHAT IS YOUR FIRST NAME";N$:PRINT +80 PRINT "HI, "N$". IN THIS GAME YOU ARE TO TAKE ORDERS" +90 PRINT "FOR PIZZAS. THEN YOU ARE TO TELL A DELIVERY BOY" +100 PRINT "WHERE TO DELIVER THE ORDERED PIZZAS.":PRINT:PRINT +140 FOR I=1 TO 16 +150 READ S$(I) +160 NEXT I +170 FOR I=1 TO 4 +180 READ M$(I) +190 NEXT I +200 DATA "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P" +210 DATA "1","2","3","4" +230 PRINT "MAP OF THE CITY OF HYATTSVILLE":PRINT +250 PRINT " ----1----2----3----4----" +260 K=4 +270 FOR I=1 TO 4 +280 PRINT "-":PRINT "-":PRINT "-":PRINT "-" +320 PRINT M$(K); +330 S1=16-4*I+1 +340 PRINT " ";S$(S1);" ";S$(S1+1);" ";S$(S1+2);" ";S$(S1+3); +350 PRINT " ";M$(K) +380 K=K-1 +390 NEXT I +400 PRINT "-":PRINT "-":PRINT "-":PRINT "-" +440 PRINT "0----1----2----3----4----":PRINT +460 PRINT "THE ABOVE IS A MAP OF THE HOMES WHERE" +470 PRINT "YOU ARE TO SEND PIZZAS.":PRINT +490 PRINT "YOUR JOB IS TO GIVE A TRUCK DRIVER" +500 PRINT "THE LOCATION OR COORDINATES OF THE" +510 PRINT "HOME ORDERING THE PIZZA.":PRINT +520 INPUT "DO YOU NEED MORE DIRECTIONS";A$ +530 IF A$="YES" THEN 590 +540 IF A$="NO" THEN 750 +550 PRINT "'YES' OR 'NO' PLEASE, NOW THEN,":GOTO 520 +590 PRINT:PRINT "SOMEBODY WILL ASK FOR A PIZZA TO BE" +600 PRINT "DELIVERED. THEN A DELIVERY BOY WILL" +610 PRINT "ASK YOU FOR THE LOCATION.":PRINT " EXAMPLE:" +620 PRINT "THIS IS J. PLEASE SEND A PIZZA." +640 PRINT "DRIVER TO "N$". WHERE DOES J LIVE?" +650 PRINT "YOUR ANSWER WOULD BE 2,3":PRINT +660 INPUT "UNDERSTAND";A$ +670 IF A$="YES" THEN 690 +680 PRINT "THIS JOB IS TOO DIFFICULT FOR YOU. THANKS ANYWAY":GOTO 999 +690 PRINT "GOOD. YOU ARE NOW READY TO START TAKING ORDERS.":PRINT +700 PRINT "GOOD LUCK!!":PRINT +750 FOR I=1 TO 5 +760 S=INT(RND*16+1):PRINT +770 PRINT "HELLO "N$"'S PIZZA. THIS IS "S$(S); +775 PRINT ". PLEASE SEND A PIZZA." +780 PRINT " DRIVER TO "N$". WHERE DOES "S$(S)" LIVE"; +790 INPUT A(1),A(2) +870 T=A(1)+(A(2)-1)*4 +880 IF T=S THEN 920 +890 PRINT "THIS IS "S$(T)". I DID NOT ORDER A PIZZA." +900 PRINT "I LIVE AT "A(1)","A(2) +910 GOTO 780 +920 PRINT "HELLO "N$". THIS IS "S$(S)", THANKS FOR THE PIZZA." +930 NEXT I +940 PRINT:INPUT "DO YOU WANT TO DELIVER MORE PIZZAS";A$ +960 IF A$="YES" THEN 750 +970 PRINT:PRINT "O.K. "N$", SEE YOU LATER!" +999 END diff --git a/dec/TARGET.BAS b/dec/TARGET.BAS new file mode 100644 index 0000000..27ddb68 --- /dev/null +++ b/dec/TARGET.BAS @@ -0,0 +1,45 @@ +100 R=1\R1=57.296\RANDOMIZE +110 PRINT "YOU ARE THE WEAPONS OFFICER ON THE STAR SHIP ENTERPRISE" +120 PRINT "AND THIS IS A TEST TO SEE HOW ACCURATE A SHOT YOU" +130 PRINT "ARE IN A THREE-DIMENSIONAL RANGE. YOU WILL BE TOLD" +140 PRINT "THE RADIAN OFFSET FOR THE X AND Z AXES, THE LOCATION" +150 PRINT "OF THE TARGET IN THREE-DIMENSIONAL RECTANGULAR COORDINATES," +160 PRINT "THE APPROXIMATE NUMBER OF DEGREES FROM THE X AND Z" +170 PRINT "AXES, AND THE APPROXIMATE DISTANCE TO THE TARGET." +180 PRINT "YOU WILL THEN PROCEEED TO SHOOT AT THE TARGET UNTIL IT IS" +190 PRINT "DESTROYED!"\PRINT\PRINT "GOOD LUCK!!"\PRINT\PRINT +220 A=RND*2*PI\B=RND*2*PI\Q=INT(A*R1)\W=INT(B*R1) +260 PRINT "RADIANS FROM X AXIS ="A" FROM Z AXIS ="B +270 PRINT "APPROX DEGREES FROM X AXIS ="Q" FROM Z AXIS ="W +280 P=100000*RND+RND\X=SIN(B)*COS(A)*P\Y=SIN(B)*SIN(A)*P\Z=COS(B)*P +340 PRINT "TARGET SIGHTED: APPROX COORDINATES X="X" Y="Y" Z="Z +345 R=R+1\IF R>5 THEN 390 +350 ON R GOTO 355,360,365,370,375 +355 P3=INT(P*.05)*20\GOTO 390 +360 P3=INT(P*.1)*10\GOTO 390 +365 P3=INT(P*.5)*2\GOTO 390 +370 P3=INT(P)\GOTO 390 +375 P3=P +390 PRINT " ESTIMATED DISTANCE="P3 +400 INPUT "INPUT ANGLE DEVIATION FROM X, DEVIATION FROM Z, DISTANCE";A1,B1,P2 +410 PRINT\IF P2<20 THEN PRINT "YOU BLEW YOURSELF UP!!"\GOTO 580 +420 A1=A1/R1\B1=B1/R1\PRINT "RADIANS FROM X AXIS ="A1" FROM Z AXIS ="B1 +480 X1=P2*SIN(B1)*COS(A1)\Y1=P2*SIN(B1)*SIN(A1)\Z1=P2*COS(B1) +510 D=((X1-X)^2+(Y1-Y)^2+(Z1-Z)^2)^(1/2) +520 IF D>20 THEN 670 +530 PRINT\PRINT " * * * HIT * * * TARGET IS NON-FUNCTIONAL"\PRINT +550 PRINT "DISTANCE OF EXPLOSION FROM TARGET WAS"D"KILOMETERS" +570 PRINT\PRINT "MISSION ACCOMPLISHED IN"R"SHOTS." +580 R=0\FOR I=1 TO 5\PRINT\NEXT I\PRINT "NEXT TARGET...."\PRINT\GOTO 220 +670 X2=X1-X\Y2=Y1-Y\Z2=Z1-Z\IF X2<0 THEN 730 +710 PRINT "SHOT IN FRONT OF TARGET"X2"KILOMETERS."\GOTO 740 +730 PRINT "SHOT BEHIND TARGET";-X2"KILOMETERS." +740 IF Y2<0 THEN 770 +750 PRINT "SHOT TO LEFT OF TARGET"Y2"KILOMETERS."\GOTO 780 +770 PRINT "SHOT TO RIGHT OF TARGET";-Y2"KILOMETERS." +780 IF Z2<0 THEN 810 +790 PRINT "SHOT ABOVE TARGET"Z2"KILOMETERS."\GOTO 8220 +810 PRINT "SHOT BELOW TARGET";-Z2"KILOMETERS." +820 PRINT "APPROX POSITION OF EXPLOSION: X="X1" Y="Y1" Z="Z1 +830 PRINT " DISTANCE FROM TARGET ="D\PRINT\PRINT\PRINT\GOTO 345 +999 END diff --git a/port/CHOMP.BAS b/port/CHOMP.BAS new file mode 100644 index 0000000..b98dc41 --- /dev/null +++ b/port/CHOMP.BAS @@ -0,0 +1,101 @@ + 100 REM ***THE GAME OF CHOMP*** + 105 REM ***SUBMITTED BY PEOPLES COMPUTER CENTER*** + 110 PRINT + 120 PRINT "THIS IS THE GAME OF CHOMP (SCIENTIFIC AMERICAN, JAN 1973)" + 130 PRINT "WANT THE RULES (1=YES, 0=NO!)"; + 140 INPUT R + 150 IF R=0 THEN 340 + 160 F=1 + 170 R=5 + 180 C=7 + 190 PRINT "CHOMP IS FOR 1 OR MORE PLAYERS (HUMANS ONLY)." + 200 PRINT + 210 PRINT "HERE'S HOW A BOARD LOOKS (THIS ONE IS 5 BY 7):" + 220 GOSUB 540 + 230 PRINT + 240 PRINT "THE BOARD IS A BIG COOKIE - R ROWS HIGH AND C COLUMNS" + 250 PRINT "WIDE. YOU INPUT R AND C AT THE START. IN THE UPPER LEFT" + 260 PRINT "CORNER OF THE COOKIE IS A POISON SQUARE (P). THE ONE WHO" + 270 PRINT "CHOMPS THE POISON SQUARE LOSES. TO TAKE A CHOMP, TYPE THE" + 280 PRINT "ROW AND COLUMN OF ONE OF THE SQUARES ON THE COOKIE." + 290 PRINT "ALL OF THE SQUARES BELOW AND TO THE RIGHT OF THAT SQUARE" + 300 PRINT "(INCLUDING THAT SQUARE, TOO) DISAPPEAR -- CHOMP!!" + 310 PRINT "NO FAIR CHOMPING SQUARES THAT HAVE ALREADY BEEN CHOMPED," + 320 PRINT "OR THAT ARE OUTSIDE THE ORIGINAL DIMENSIONS OF THE COOKIE." + 330 PRINT + 340 PRINT "HERE WE GO..." + 350 DIM A(10,10) + 360 F=0 + 370 FOR I=1 TO 10 + 372 FOR J=1 TO 10 + 375 A(I,J)=0 + 377 NEXT J + 379 NEXT I + 380 PRINT + 390 PRINT "HOW MANY PLAYERS"; + 400 INPUT P + 410 I1=0 + 420 PRINT "HOW MANY ROWS"; + 430 INPUT R + 440 IF R <= 9 THEN 470 + 450 PRINT "TOO MANY ROWS (9 IS MAXIMUM). NOW, "; + 460 GOTO 420 + 470 PRINT "HOW MANY COLUMNS"; + 480 INPUT C + 490 IF C <= 9 THEN 530 + 500 PRINT "TOO MANY COLUMNS (9 IS MAXIMUM). NOW, "; + 510 GOTO 470 + 530 PRINT + 540 FOR I=1 TO R + 550 FOR J=1 TO C + 560 A(I,J)=1 + 570 NEXT J + 580 NEXT I + 590 A(1,1)=-1 + 600 REM PRINT THE BOARD + 610 PRINT + 620 PRINT TAB(7);"1 2 3 4 5 6 7 8 9" + 630 FOR I=1 TO R + 640 PRINT I;TAB(7); + 650 FOR J=1 TO C + 660 IF A(I,J)=-1 THEN 700 + 670 IF A(I,J)=0 THEN 720 + 680 PRINT "* "; + 690 GOTO 710 + 700 PRINT "P "; + 710 NEXT J + 720 PRINT + 730 NEXT I + 740 PRINT + 750 IF F=0 THEN 770 + 760 RETURN + 770 REM GET CHOMPS FOR EACH PLAYER IN TURN + 780 LET I1=I1+1 + 790 LET P1=I1-INT(I1/P)*P + 800 IF P1 <> 0 THEN 820 + 810 P1=P + 820 PRINT "PLAYER";P1 + 830 PRINT "COORDINATES OF CHOMP (ROW,COLUMN)"; + 840 INPUT R1,C1 + 850 IF R1<1 THEN 920 + 860 IF R1>R THEN 920 + 870 IF C1<1 THEN 920 + 880 IF C1>C THEN 920 + 890 IF A(R1,C1)=0 THEN 920 + 900 IF A(R1,C1)=-1 THEN 1010 + 910 GOTO 940 + 920 PRINT "NO FAIR. YOU'RE TRYING TO CHOMP ON EMPTY SPACE!" + 930 GOTO 820 + 940 FOR I=R1 TO R + 950 FOR J=C1 TO C + 960 A(I,J)=0 + 970 NEXT J + 980 NEXT I + 990 GOTO 610 +1000 REM END OF GAME DETECTED IN LINE 900 +1010 PRINT "YOU LOSE, PLAYER ";P1 +1020 PRINT +1030 PRINT "AGAIN (1=YES, 0=NO!)"; +1040 INPUT R +1050 IF R=1 THEN 340 +1060 END diff --git a/port/PIZZA.BAS b/port/PIZZA.BAS new file mode 100644 index 0000000..ae923cd --- /dev/null +++ b/port/PIZZA.BAS @@ -0,0 +1,65 @@ + 10 DIM S$(16),A(2),M$(4) + 20 RANDOMIZE + 30 PRINT "PIZZA DELIVERY GAME"\PRINT + 50 PRINT "WHAT IS YOUR FIRST NAME";\INPUT N$\PRINT + 80 PRINT "HI, "N$". IN THIS GAME YOU ARE TO TAKE ORDERS" + 90 PRINT "FOR PIZZAS. THEN YOU ARE TO TELL A DELIVERY BOY" + 100 PRINT "WHERE TO DELIVER THE ORDERED PIZZAS."\PRINT\PRINT + 140 FOR I=1 TO 16 + 150 READ S$(I) + 160 NEXT I + 170 FOR I=1 TO 4 + 180 READ M$(I) + 190 NEXT I + 200 DATA "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P" + 210 DATA "1","2","3","4" + 230 PRINT "MAP OF THE CITY OF HYATTSVILLE"\PRINT + 250 PRINT " ----1----2----3----4----" + 260 K=4 + 270 FOR I=1 TO 4 + 280 PRINT "-"\PRINT "-"\PRINT "-"\PRINT "-" + 320 PRINT M$(K); + 330 S1=16-4*I+1 + 340 PRINT " ";S$(S1);" ";S$(S1+1);" ";S$(S1+2);" ";S$(S1+3); + 350 PRINT " ";M$(K) + 380 K=K-1 + 390 NEXT I + 400 PRINT "-"\PRINT "-"\PRINT "-"\PRINT "-" + 440 PRINT "0----1----2----3----4----"\PRINT + 460 PRINT "THE ABOVE IS A MAP OF THE HOMES WHERE" + 470 PRINT "YOU ARE TO SEND PIZZAS."\PRINT + 490 PRINT "YOUR JOB IS TO GIVE A TRUCK DRIVER" + 500 PRINT "THE LOCATION OR COORDINATES OF THE" + 510 PRINT "HOME ORDERING THE PIZZA."\PRINT + 520 PRINT "DO YOU NEED MORE DIRECTIONS";\INPUT A$ + 530 IF A$="YES" THEN 590 + 540 IF A$="NO" THEN 750 + 550 PRINT "'YES' OR 'NO' PLEASE, NOW THEN,"\GOTO 520 + 590 PRINT\PRINT "SOMEBODY WILL ASK FOR A PIZZA TO BE" + 600 PRINT "DELIVERED. THEN A DELIVERY BOY WILL" + 610 PRINT "ASK YOU FOR THE LOCATION."\PRINT " EXAMPLE:" + 620 PRINT "THIS IS J. PLEASE SEND A PIZZA." + 640 PRINT "DRIVER TO "N$". WHERE DOES J LIVE?" + 650 PRINT "YOUR ANSWER WOULD BE 2,3"\PRINT + 660 PRINT "UNDERSTAND";\INPUT A$ + 670 IF A$="YES" THEN 690 + 680 PRINT "THIS JOB IS TOO DIFFICULT FOR YOU. THANKS ANYWAY"\GOTO 999 + 690 PRINT "GOOD. YOU ARE NOW READY TO START TAKING ORDERS."\PRINT + 700 PRINT "GOOD LUCK!!"\PRINT + 750 FOR I=1 TO 5 + 760 S=INT(RND(1)*16+1)\PRINT + 770 PRINT "HELLO "N$"'S PIZZA. THIS IS "S$(S); + 775 PRINT ". PLEASE SEND A PIZZA." + 780 PRINT " DRIVER TO "N$". WHERE DOES "S$(S)" LIVE"; + 790 INPUT A(1),A(2) + 870 T=A(1)+(A(2)-1)*4 + 880 IF T=S THEN 920 + 890 PRINT "THIS IS "S$(T)". I DID NOT ORDER A PIZZA." + 900 PRINT "I LIVE AT "A(1)","A(2) + 910 GOTO 780 + 920 PRINT "HELLO "N$". THIS IS "S$(S)", THANKS FOR THE PIZZA." + 930 NEXT I + 940 PRINT\PRINT "DO YOU WANT TO DELIVER MORE PIZZAS";\INPUT A$ + 960 IF A$="YES" THEN 750 + 970 PRINT\PRINT "O.K. "N$", SEE YOU LATER!" + 999 END diff --git a/port/TARGET.BAS b/port/TARGET.BAS new file mode 100644 index 0000000..99e6c3a --- /dev/null +++ b/port/TARGET.BAS @@ -0,0 +1,46 @@ + 100 R=1\R1=57.296\P1=3.141592\RANDOMIZE + 110 PRINT "YOU ARE THE WEAPONS OFFICER ON THE STAR SHIP ENTERPRISE" + 120 PRINT "AND THIS IS A TEST TO SEE HOW ACCURATE A SHOT YOU" + 130 PRINT "ARE IN A THREE-DIMENSIONAL RANGE. YOU WILL BE TOLD" + 140 PRINT "THE RADIAN OFFSET FOR THE X AND Z AXES, THE LOCATION" + 150 PRINT "OF THE TARGET IN THREE-DIMENSIONAL RECTANGULAR COORDINATES," + 160 PRINT "THE APPROXIMATE NUMBER OF DEGREES FROM THE X AND Z" + 170 PRINT "AXES, AND THE APPROXIMATE DISTANCE TO THE TARGET." + 180 PRINT "YOU WILL THEN PROCEEED TO SHOOT AT THE TARGET UNTIL IT IS" + 190 PRINT "DESTROYED!"\PRINT\PRINT "GOOD LUCK!!"\PRINT\PRINT + 220 A=RND(1)*2*P1\B=RND(1)*2*P1\Q=INT(A*R1)\W=INT(B*R1) + 260 PRINT "RADIANS FROM X AXIS ="A" FROM Z AXIS ="B + 270 PRINT "APPROX DEGREES FROM X AXIS ="Q" FROM Z AXIS ="W + 280 P=100000*RND(1)+RND(1)\X=SIN(B)*COS(A)*P\Y=SIN(B)*SIN(A)*P\Z=COS(B)*P + 340 PRINT "TARGET SIGHTED: APPROX COORDINATES X="X" Y="Y" Z="Z + 345 R=R+1\IF R>5 THEN 390 + 350 ON R GOTO 355,360,365,370,375 + 355 P3=INT(P*.05)*20\GOTO 390 + 360 P3=INT(P*.1)*10\GOTO 390 + 365 P3=INT(P*.5)*2\GOTO 390 + 370 P3=INT(P)\GOTO 390 + 375 P3=P + 390 PRINT " ESTIMATED DISTANCE="P3 + 400 PRINT "INPUT ANGLE DEVIATION FROM X, DEVIATION FROM Z, DISTANCE"; + 405 INPUT A1,B1,P2 + 410 PRINT\IF P2>=20 THEN 420\PRINT "YOU BLEW YOURSELF UP!!"\GOTO 580 + 420 A1=A1/R1\B1=B1/R1\PRINT "RADIANS FROM X AXIS ="A1" FROM Z AXIS ="B1 + 480 X1=P2*SIN(B1)*COS(A1)\Y1=P2*SIN(B1)*SIN(A1)\Z1=P2*COS(B1) + 510 D=((X1-X)^2+(Y1-Y)^2+(Z1-Z)^2)^(1/2) + 520 IF D>20 THEN 670 + 530 PRINT\PRINT " * * * HIT * * * TARGET IS NON-FUNCTIONAL"\PRINT + 550 PRINT "DISTANCE OF EXPLOSION FROM TARGET WAS"D"KILOMETERS" + 570 PRINT\PRINT "MISSION ACCOMPLISHED IN"R"SHOTS." + 580 R=0\FOR I=1 TO 5\PRINT\NEXT I\PRINT "NEXT TARGET...."\PRINT\GOTO 220 + 670 X2=X1-X\Y2=Y1-Y\Z2=Z1-Z\IF X2<0 THEN 730 + 710 PRINT "SHOT IN FRONT OF TARGET"X2"KILOMETERS."\GOTO 740 + 730 PRINT "SHOT BEHIND TARGET";-X2"KILOMETERS." + 740 IF Y2<0 THEN 770 + 750 PRINT "SHOT TO LEFT OF TARGET"Y2"KILOMETERS."\GOTO 780 + 770 PRINT "SHOT TO RIGHT OF TARGET";-Y2"KILOMETERS." + 780 IF Z2<0 THEN 810 + 790 PRINT "SHOT ABOVE TARGET"Z2"KILOMETERS."\GOTO 820 + 810 PRINT "SHOT BELOW TARGET";-Z2"KILOMETERS." + 820 PRINT "APPROX POSITION OF EXPLOSION: X="X1" Y="Y1" Z="Z1 + 830 PRINT " DISTANCE FROM TARGET ="D\PRINT\PRINT\PRINT\GOTO 345 + 999 END