0 RANDOMIZE TIMER
10 CLS: PRINT "WARFISH"
20 PRINT : PRINT TAB(7) "COPYRIGHT 1979 CREATIVE COMPUTING MORRISTOWN NJ"
30 PRINT "";: INPUT "DO YOU NEED INSTRUCTIONS";I$
40 Q0=RND(1)
50 REM
60 IF LEFT$(I$,1)="N" THEN CLS: GOTO 190
70 CLS:PRINT TAB(28); "WARFISH":PRINT 
80 PRINT "YOU COMMAND AN AMERICAN SUBMARINE THAT HAS BEEN SENT OUT"
90 PRINT "TO ATTACK JAPANESE SHIPS AT SEA DURING WORLD WAR II."
100 PRINT 
110 PRINT "THE ORDERS THAT CAN BE GIVEN ARE THE FOLLOWING:"
120 PRINT "  PERISCOPE - TO SEARCH FOR JAPANESE SHIPS."
130 PRINT "  TORPEDO - TO LAUNCH TORPEDOES AT JAPANESE SHIPS."
140 PRINT "  DIVE - TO ESCAPE ATTACKING JAPANESE SHIPS."
150 PRINT "THESE ARE SOME HISTORIC U.S. NAVY SUBMARINES:":PRINT 
160 PRINT "  TAUTOG, SILVERSIDES, CAVALLA, BLUEFISH, THRESHER"
170 PRINT "  SWORDFISH, FLASHER, TROUT, ARCHER.":PRINT 
180 PRINT "SELECT ONE OF THE ABOVE, OR USE A NAME OF YOUR CHOICE."
190 PRINT "PRINT THE NAME OF YOUR SUBMARINE";
200 INPUT A$
210 T=26
220 D=INT(RND(1)*10)
230 IF D<6 THEN 380
240 IF D<>6 AND D<>7 THEN 270
250 R$="DESTROYER"
260 W=2100
270 IF D<>8 THEN 300
280 R$="DESTROYER ESCORT"
290 W=1350
300 IF D<>9 THEN 330
310 R$="TORPEDO BOAT"
320 W=70
330 IF D=6 OR D=7 THEN 360
340 Q=1
350 GOTO 370
360 Q=2
370 PRINT "JAPANESE"; R$; " IS ATTACKING."
380 IF D>=6 THEN 400
390 A=INT(RND(1)*10)
400 REM
410 PRINT "ORDERS, COMMANDER";
420 INPUT C$
430 CLS: C$=MID$(C$,1,1)
440 IF C$="P" THEN 480
450 IF C$="T" THEN 1100
460 IF C$="D" THEN 1370
470 GOTO 410
480 IF D>5 OR Q>0 THEN 1080
490 IF A>=4 THEN 570
500 R$="FREIGHTER"
510 IF A<>0 AND A<>1 THEN 530
520 W=6500
530 IF A<>2 THEN 550
540 W=7500
550 IF A<>3 THEN 570
560 W=8100
570 IF A<>7 AND A<>8 THEN 630
580 R$="TANKER"
590 IF A<>8 THEN 620
600 W=10000
610 GOTO 630
620 W=9500
630 IF A<>4 AND A<>5 THEN 690
640 R$="TRANSPORT"
650 IF A<>5 THEN 680
660 W=11500
670 GOTO 690
680 W=8800
690 IF A<>6 THEN 720
700 R$="AMMUNITION SHIP"
710 W=9650
720 IF A>=9 OR A=6 THEN 740
730 Q=1
740 IF A<>6 THEN 760
750 Q=1
760 IF A<9 THEN 1080
770 E=INT(RND(1)*10)
780 IF E<>0 THEN 810
790 R$="BATTLESHIP"
800 W=33500
810 IF E<>1 THEN 840
820 R$="AIRCRAFT CARRIER"
830 W=25700
840 IF E<>2 THEN 870
850 R$="HEAVY CRUISER"
860 W=9900
870 IF E<>3 THEN 900
880 R$="LIGHT CRUISER"
890 W=9600
900 IF E<>4 AND E<>5 THEN 930
910 R$="DESTROYER"
920 W=2100
930 IF E<>6 AND E<>7 THEN 960
940 R$="SUBMARINE"
950 W=1500
960 IF E<>8 AND E<>9 THEN 980
970 W=1350
980 IF E<=5 THEN 1000
990 Q=1
1000 IF E<>4 AND E<>5 THEN 1020
1010 Q=2
1020 IF E<>2 AND E<>3 THEN 1040
1030 Q=3
1040 IF E<>1 THEN 1060
1050 W=4
1060 IF E<>0 THEN 1080
1070 Q=7
1080 PRINT "JAPANESE "; R$; " -"; W; "TONS."
1090 GOTO 400
1100 IF Q>=1 THEN 1130
1110 PRINT "NO JAPANESE SHIPS IN SIGHT - JUST OCEAN."
1120 IF Q<1 THEN 410
1130 PRINT T; "TORPEDOES LEFT."
1140 PRINT "NUMBER OF TORPEDOES TO FIRE";
1150 INPUT R
1160 IF R<0 OR T-R<0 THEN 1140
1170 IF R<>INT(R) THEN 1140
1180 T=T-R
1190 S=INT(RND(1)*10)
1200 IF S>R THEN 1190
1210 Q=Q-S
1220 IF Q<=0 THEN 1240
1230 Q$="DAMAGED"
1240 IF Q>=1 THEN 1280
1250 Q$="SUNK"
1260 O=O+W
1270 L=L+1
1280 PRINT R; "TORPEDOES FIRED -"; S; "HITS ";
1290 IF S<>0 THEN 1310
1300 PRINT 
1310 IF S<=0 THEN 1330
1320 PRINT "- ";R$;" ";Q$; "."
1330 IF D>5 AND Q>0 THEN 1560
1340 IF T<1 THEN 1580
1350 IF Q<1 THEN 220
1360 GOTO 400
1370 IF D>=6 THEN 1390
1380 PRINT " THE USS "; A$; " IS NOT UNDER ATTACK."
1390 IF D<6 THEN 410
1400 U=INT(RND(1)*10)*250
1410 PRINT "DISTANCE OF ";R$;TAB(32);"DEPTH OF USS ";A$
1420 FOR XX=1 TO 63:PRINT "=";:NEXT
1430 PRINT U;"YARDS"; TAB(32);Z;"FEET"
1440 U=U-250
1450 Z=Z+25
1460 IF U>-250 THEN 1430
1470 IF R$="TORPEDO BOAT" THEN 1510
1480 N=INT(RND(1)*10)*25+50
1490 IF N+26>Z AND N-26<Z THEN 1540
1500 U=0:Z=0
1510 PRINT :PRINT "THE USS ";A$;" IS UNHURT."
1520 Q=0
1530 GOTO 220
1540 PRINT "THE USS ";A$;" HAS BEEN SUNK BY DEPTH CHARGES."
1550 GOTO 1610
1560 FOR I=1 TO 1500:NEXT I
1565 PRINT "THE USS ";A$;" HAS BEEN SUNK BY GUNFIRE."
1570 GOTO 1610
1580 FOR I=1 TO 1500:NEXT I
1585 PRINT "THE USS ";A$;" HAS EXPENDED ALL ITS TORPEDOES."
1590 IF O<=0 THEN 1610
1600 PRINT :PRINT "CONGRATULATIONS ON A SUCCESSFUL DEPLOYMENT."
1610 PRINT 
1620 PRINT "THE SUBMARINE USS ";A$;" HAS SUNK A TOTAL OF"; L;"SHIPS."
1630 PRINT "TOTAL ENEMY TONNAGE SUNK: ";O;"TONS"
1640 PRINT :PRINT 
1650 INPUT "DO YOU WANT TO TRY AGAIN";ANS$
1660 IF LEFT$(ANS$,1)="Y" THEN 190 

1661 IF LEFT$(ANS$,1)="N" THEN END
1662 PRINT "INVALID RESPONSE.":GOTO 1650