5 PRINT TAB(26);"SEAWAR" 6 PRINT TAB(20);"CREATIVE COMPUTING" 7 PRINT TAB(18) "MORRISTOWN, NEW JERSEY" 9 PRINT:PRINT:PRINT 10 PRINT "YOU COMMAND A FLEET OF SHIPS OPERATING IN" 15 PRINT "ENEMY TERRITORY!!!" 20 PRINT "DO YOU NEED ANY ASSISTANCE"; 40 INPUT Q$ 50 IF Q$="YES" THEN 90 60 IF Q$="NO" THEN 170 70 PRINT "INPUT 'YES' OR 'NO'" 80 GOTO 40 90 PRINT "YOU TELL YOUR GUN CREWS THE ELEVATION TO SET THEIR GUNS." 100 PRINT "ELEVATION IS IN DEGREES FROM 0 TO 360." 119 PRINT "YOUR TASK FORCE CONSISTS OF 3 DESTROYERS, 2 CRUISERS," 120 PRINT "2 BATTLESHIPS, AND 2 HEAVY AIRCRAFT CARRIERS." 130 PRINT "THE ENEMY HAS 9 SHIPS FOR HIS DEFENSE." 140 PRINT "IF YOU SUCCEED IN SINKING ALL HIS SHIPS BEFORE HE SINKS" 150 PRINT"YOURS, YOU HAVE WON. HOWEVER, IF HE SINKS ALL YOUR SHIPS" 160 PRINT "BEFORE YOU HAVE DEFEATED HIM, YOU HAVE LOST!!" 170 PRINT "LET US BEGIN!!!" 210 PRINT "" 220 READ Z$ 230 A=A+1 240 GOTO 320 250 RESTORE 260 IF O=9 OR A=9 THEN 840 270 FOR X=1 TO A 280 READ Z$ 290 NEXT X 300 READ Z$ 310 A=A+1 320 IF Z$="AIRCRAFT CARRIER" THEN 390 330 IF Z$="U-BOAT" THEN 2000 340 IF Z$="TORPEDO BOAT" THEN 360 350 P=1 360 GOTO 405 390 RESTORE 405 PRINT:PRINT "YOUR FLAGSHIP REPORTS THE SIGHTING OF AN ENEMY ";Z$ 410 T=43000.-30000*RND(0)+(RND(0)*10)*.987654+102 420 IF T<10000 THEN 410 430 S=0:P2=0 440 T=INT(T) 450 IF Z$="U-BOAT" THEN 2030 460 PRINT "YOUR INSTRUMENTS READ THE RANGE TO THE TARGET AS ";T;" METERS." 480 IF P=1 THEN 1480 490 IF S>4 THEN 510 500 GOTO 540 510 PRINT "ALL RIGHT, BAD SHOT, THE TARGET HAS MOVED OUT OF" 520 PRINT "RANGE !!! LET'S TRY IT AGAIN !!!" 525 S1=S1+S 530 GOTO 320 540 PRINT "WHAT ELEVATION ** "; 550 INPUT B 551 PRINT 570 PRINT "" 590 PRINT "-----FIRE!!!" 600 S=S+1 620 IF B>360 THEN 1410 630 IF B<0 THEN 750 640 IF B=0 THEN 770 650 IF B=90 THEN 980 660 IF B>330 THEN 770 670 IF B>180 THEN 1370 680 IF B>150 THEN 1300 690 IF B>90 THEN 1020 700 V1=675.285 705 E=INT(T-(V1^2/9.80665*SIN(2*B/57.3))) 710 IF ABS(E) <= 100 THEN 1050 720 IF E>100 THEN 1200 730 IF E<-100 THEN 1250 750 PRINT "GUN BACKFIRED, KILLING CREW!" 760 GOTO 820 770 PRINT "WHAT ARE YOU TRYING TO DO? KILLSOME FISH? THE SHELL" 780 PRINT "EXPLODED UNDER WATER FIFTY METERS FROM YOUR SHIP!!!" 790 GOTO 1590 820 PRINT " ADMIRAL PLEASE !!!!" 830 GOTO 1590 840 PRINT " ******** PEACE ********" 870 PRINT:PRINT:PRINT 890 PRINT "YOU FIRED ",S1," ROUNDS. THE ENEMY FIRED ",S2," ROUNDS." 900 IF O=9 THEN 920 910 IF A=9 THEN 950 920 PRINT "ALL OF YOUR SHIPS HAVE BEEN SUNK. SO SORRY" 930 PRINT "THE BATTLE IS OVER..........THE ENEMY WINS!" 940 GOTO 2220 950 PRINT "YOU HAVE DECIMATED THE ENEMY..........THAT'S NICE" 960 PRINT "THE BATTLE IS OVER..........YOU WIN!!!!!" 970 GOTO 2220 980 PRINT "YOU IDIOT!! YOU SHOT STRAIGHT UP!!, AND THE SHELL" 990 PRINT "LANDED ON YOUR OWN GUN POSITION, DESTROYING IT!!!" 1000 GOTO 1590 1020 PRINT "HEY STUPID, YOU'RE FIRING ON YOUR OWN SHIPS!!!" 1030 GOTO 1590 1050 IF Z$="U-BOAT" THEN 1070 1060 GOTO 1090 1070 PRINT "DEPTH CHARGE EXPLODED RIGHT ON TOP OF THAT BABY!!!" 1080 GOTO 1100 1090 PRINT " ** BOOM **" 1100 PRINT "" 1110 M$="TARGET DESTROYED!!! **" 1120 N$=" ** ROUNDS EXPENDED." 1130 PRINT M$;S;N$ 1142 PRINT "YOU HAVE LOST ";O;" SHIPS, AND THE ENEMY HAS LOST ";A;"." 1150 S1=S1+S 1160 PI=0 1190 GOTO 250 1200 IF Z$="U-BOAT" THEN 2130 1210 PRINT "SHOT FELL ";ABS(E);" METERS SHORT OF TARGET." 1230 GOTO 1590 1250 IF Z$="U-BOAT" THEN 2160 1260 PRINT "SHELL OVERSHOT TARGET BY ";ABS(E);" METERS." 1280 GOTO 1590 1310 PRINT " YOU SHOT A PROJECTILE, INTO THE AIR," 1320 PRINT " IT FELL TO THE WATER, YOU KNOW NOT WHERE." 1330 PRINT "BUT I DO, YOU IDIOT, YOU JUST SANK YOUR OWN FLEET TANKER!!" 1340 S1=S1+1 1350 IF P=1 THEN 1590 1360 GOTO 490 1370 PRINT "WHAT ARE YOU TRYING TO DO?? DRILL A NEW HATCH?? THE SHELL" 1380 PRINT "EXPLODED IN YOUR SHIP, DESTROYING IT!!!" 1385 O=O+1 1386 IF O=9 THEN 840 1390 IF P=1 THEN 1590 1400 GOTO 820 1410 PRINT "WHERE DID U LEARN TO TYPE? ";B;"DEGREES EXCEEDS 360 BY" 1420 PRINT B-360;" DEGREES." 1430 S1=S1+1 1440 IF P=1 THEN 1590 1450 GOTO 490 1480 PRINT "THE ENEMY ";Z$;" IS FIRING ON YOUR SHIPS!" 1490 P4=1234*RND(RND(0))+(RND(0)*10) 1500 IF P4>500 THEN 1490 1510 IF P2=1 THEN 1600 1520 IF INT(P4)<100 THEN 1800 1530 IF Z$="U-BOAT" THEN 2100 1540 PRINT "HIS FIRST ROUND FELL ";INT(P4);" METERS SHORT." 1560 S2=S2+1 1570 GOTO 490 1590 IF P2=1 THEN 1490 1600 P1=1250*RND(RND(0))+(RND(0)*10) 1610 IF P1>P4 THEN 1600 1620 IF P1<(P4-400) THEN 1600 1630 IF P1<100 THEN 1710 1640 P4=P1 1650 S2=S2+1 1660 IF Z$="U-BOAT" THEN 2190 1670 PRINT "THE ENEMY ROUND FELL ";INT(P1);" METERS SHORT." 1700 GOTO 490 1710 S2=S2+1 1720 P2=1 1730 GOSUB 1850 1750 PRINT "THE ENEMY ";Z$;" SANK ";D$ 1760 O=O+1 1770 IF O=9 THEN 840 1780 IF D$="YOUR LAST BATTLESHIP!!" THEN 840 1790 GOTO 490 1800 R2=1 1810 GOSUB 1850 1820 PRINT "IN FACT, HE JUST SANK ";D$ 1830 O=O+1 1840 GOTO 1770 1850 RESTORE 1860 FOR C=1 TO (9+O) 1870 READ D$ 1880 NEXT C 1890 READ D$ 1920 DATA "U-BOAT","210 MM SHORE GUN","70,000 TON CRUISER" 1930 DATA "BATTLESHIP","TORPEDO BOAT","HEAVYFRIGATE" 1940 DATA "E-TYPE DESTROYER","GUIDED-MISSLE SHIP","AIRCRAFT CARRIER" 1950 DATA "ONE OF YOUR DESTROYERS!!","YOUR HEAVY CRUISER!!" 1960 DATA "ANOTHER OF YOUR DESTROYERS!!","ONE OF YOUR BATTLESHIPS!!" 1970 DATA "YOUR LAST DESTROYER!!","YOUR AIRCRAFT CARRIER!!" 1975 DATA "YOUR LIGHT CRUISER!!","YOUR LAST AIRCRAFT CARRIER!!" 1980 DATA "YOUR LAST BATTLESHIP!!" 1990 RETURN 2000 PRINT "YOUR FLAGSHIP HAS DETECTED A U-BOAT APPROACHING AT 5 "; 2005 PRINT "PHANTOMS." 2010 P=1 2020 GOTO 410 2030 PRINT "YOUR SUBMARINE DETECTION EQUIPMENT READS THE RANGE TO THE"; 2031 PRINT " TARGET" 2040 T=INT(T-1500) 2050 IF T<0 THEN 410 2060 PRINT "AS ";T;" METERS." 2080 PRINT "THE U-BOAT HAS COMMENCED FIRING TORPEDOES AT YOUR SHIPS." 2090 GOTO 1490 2100 PRINT "HIS FIRST TORPEDO EXPLODED ";(INT(P4)-50);" METERS BEHIND"; 2105 PRINT " YOUR SHIP." 2120 GOTO 1560 2130 PRINT "DEPTH CHARGE EXPLODED ";ABS(E);" METERS SHORT OF TARGET." 2150 GOTO 1590 2160 PRINT "DEPTH CHARGE EXPLODED ";ABS(E);" METERS AFT OF TARGET." 2180 GOTO 1590 2190 PRINT "THE ENEMY TORPEDO EXPLODED ";(INT(P1)-50);"METERS IN" 2201 PRINT "FRONT OF YOUR SHIP." 2210 GOTO 490 2220 END