190 PRINT " Your mission as the commander of a": PRINT "submarine, is to destroy as many ships": PRINT "as you can with your limited supply of": PRINT "torpedoes."
200 PRINT " Use game paddle #0 to control the": PRINT "position of the crosshairs, and the": PRINT "button to fire torpedoes.": PRINT : PRINT " There are three types of ships:"
210 POKE 7,147: PRINT : FOR I = 1 TO 3: PRINT " "SHIP$(I,0): NEXT : POKE 7,144: VTAB PEEK(37) -2
260 Y = 17:TRP = 0:SHIP = 5:HS = 0:BLANK$ = " ": FOR I = 1 TO 5:BLANK$ = BLANK$ +" ": NEXT
270 DIM SC(10),N$(10):D$ = CHR$(4)
280 REM READ IN TOP SCORES IF NECESSARY
290 PRINT : INVERSE : PRINT "Want the all time top scores (Y or N)? ";: NORMAL : POKE 24,255: GET A$: PRINT A$;: IF A$ = "N" OR A$ = CHR$(110) THEN F = 1: GOTO 330
300 F$ = "HIGH.SCORES"
310 PRINT D$"CLOSE": PRINT D$"OPEN HIGH.SCORES": PRINT D$"READ HIGH.SCORES": FOR I = 1 TO 10: INPUT SC(I),N$(I): NEXT : PRINT D$"CLOSE":F$ = "":HS = SC(1)
320 REM START OF GAME - PRINT MESSAGES AND DRAW SCREEN
370 REM DECIDE ON SHIP SPEED AND STARTING LOCATION
380 A = RND(1):INC = (A < = 0.4) +2 *(A >0.4 AND A < = 0.8) +3 *(A >0.8): IF RND(1) <0.5 THEN INC = -INC
390 LOCN = 36 *(INC <0)
400 REM FIND NEW CROSSHAIR POSITION
410 X = FN PAD(0): IF X < >XB THEN VTAB Y: HTAB XB: PRINT " ";: HTAB X: POKE 7,147: PRINT "P": POKE 7,144
420 REM IF BUTTON PRESSED, FIRE TORPEDO
430 XB = X: IF FIRE = 1 OR FN BUT(0) = 0 OR MISSILE = 0 THEN 460
440 & WINDOW(1,20 TO 38,23):FIRE = 1:MISSILE = MISSILE -1: VTAB 22: HTAB 38 - LEN( STR$(MISSILE)): PRINT " "MISSILE;:MY = Y -1:MX = X: & WINDOW(1,1 TO 38,2)
450 REM DRAW NEW SHIP POSITION AND SEE IF OFF SCREEN
460 A = LOCN +INC -( ABS(INC) = 3) * SGN(INC): IF A <1 OR (LOCN +5 -INC >37 AND INC >0) THEN VTAB 3: HTAB LOCN: PRINT LEFT$(BLANK$, ABS(INC)): GOTO 540
470 LOCN = A: GOSUB 720
480 REM IF TORPEDO FIRED, MOVE IT AND SEE IF SHIP HIT
490 IF FIRE = 0 THEN 410
500 MY = MY -1: GOSUB 750: IF MY < >6 THEN 410
510 FOR I = 0 TO 4 - ABS(INC): IF LOCN +I = MX THEN GOSUB 770: GOTO 540
520 REM SHIP NOT HIT SO SPLASH!
530 NEXT I:FIRE = 0: VTAB MY -1: HTAB MX: PRINT " ";: VTAB 3: HTAB MX: POKE 7,147: PRINT CHR$(112): POKE 7,144: FOR I = 1 TO 20: NEXT : HTAB MX: PRINT " ";: IF MISSILE >0 THEN 410
540 IF MISSILE >0 THEN 380
550 REM WANT ANOTHER TRY?
560 FIRE = 0: IF SC >SC(10) THEN 630
570 VTAB 22: & CLEAR P: PRINT : PRINT "Want to try again (Y or N)? ";: POKE 24,255: GET B$: PRINT B$: IF B$ < >"N" AND B$ < > CHR$(110) THEN FLAG = 0: GOTO 330
580 REM SAVE HIGH SCORES
590 F$ = ""
600 PRINT D$"OPEN HIGH.SCORES": PRINT D$"WRITE HIGH.SCORES": FOR I = 1 TO 10: PRINT SC(I): PRINT N$(I): NEXT : PRINT D$"CLOSE"
610 PRINT D$"PR#0": PRINT D$"IN#0": TEXT : HOME : END
620 REM GET NEW NAME
630 & WINDOW(0,0 TO 39,23): & HOME : PRINT "Your score was one of the TOP TEN.": PRINT "Please enter your name (10 letters at": PRINT "most, please): "
670 FOR J = 10 TO I STEP -1:SC(J) = SC(J -1):N$(J) = N$(J -1): NEXT :SC(I) = SC:N$(I) = A$
680 REM SHOW HIGH SCORES
690 & HOME : INVERSE : HTAB 12: PRINT " TOP TEN SCORES ": NORMAL : VTAB 3: FOR I = 1 TO 10: IF SC(I) < >0 THEN HTAB 12 - LEN( STR$(I)): PRINT I" "N$(I) TAB( 29 - LEN( STR$(SC(I))))SC(I): PRINT : NEXT
700 HS = SC(1): GOTO 570
710 REM DRAW SHIP
720 IF LOCN >INC AND INC >0 THEN VTAB 3: HTAB LOCN -INC: PRINT LEFT$(BLANK$,INC);