Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REM PROG=P0
- 2 POKE 214,128
- 5 POKE 24576,0: POKE 230,32: TEXT : HOME : FOR A = 768 TO 790: READ B: POKE A,B: NEXT
- 70 HTAB 4: VTAB 12: INVERSE : PRINT " LOADING INITIALIZATION PHASE ": NORMAL
- 80 CALL 768: & RUN "P1",24577
- 1000 DATA 160,0,169,32,132,0,133,1,152,145,0,200,208,251,230,1,165,1,201,96,208,242,96
- REM PROG = P1
- 4 LOMEM: 38400
- 2573
- 17487 E%(15),X%(15),Y%(15),SCALE%(15),XROT%(15),YROT%(15),ZROT%(15),SX%(15),SY%(15)
- 20 RESET% = 7932:CLR% = 7951:HIRES% = 7983:CRNCH% = 7737:TXTGEN% = 768
- 50 I = FRE (0)
- 52 PI = 355 / 113
- 60 & RECALL "HT": CALL 3072
- 150 FOR I = 16386 TO 16406
- 152 READ J
- 154 POKE I,J
- 156 NEXT
- 158 DATA 173,48,192,136,208,5
- 160 DATA 206,1,64,240,9,202,208
- 162 DATA 245,174,0,64,76,2,64,96
- 163 DATA 210,50,210,50,190,50,170,50,210,50,170,50,190,50
- 164 DATA 250,170,185,70,200,20,190,50,150,150,190,200
- 165 DATA 210,50,190,50,170,50,150,20,190,50,150,100
- 166 FOR X1 = 2450 TO 2487: READ X: POKE X1,X: NEXT
- 170 GOTO 180
- 175 POKE 16384,XA: POKE 16385,XB: CALL 16386: RETURN
- 180 POKE 772,20: PRINT CHR$ (5): PRINT CHR$ (3);"9": PRINT CHR$ (2);"0": PRINT CHR$ (3);"3": PRINT CHR$ (12): PRINT CHR$ (16)
- 185 PRINT " !.#$%&'()*+,-"
- 190 PRINT " 0123456789:;<="
- 195 PRINT " @ABCDEFGHIJKLM"
- 200 PRINT " PQRSTUVWXYZ"; CHR$ (91); CHR$ (92);"]"
- 202 PRINT " ";
- 205 FOR LM = 96 TO 110
- 207 PRINT CHR$ (LM);
- 208 NEXT
- 209 PRINT "": PRINT " ";
- 210 FOR LM = 112 TO 126
- 212 PRINT CHR$ (LM);
- 214 NEXT
- 216 PRINT ""
- 220 POKE 772,28: PRINT CHR$ (18): PRINT CHR$ (0)
- 225 PRINT " Strategic Simulations Incorporated"
- 230 HTAB 17: PRINT "presents"
- 232 HTAB 12: PRINT "a game designed by"
- 236 HTAB 16: PRINT "John Lyon"
- 245 GOSUB 20080
- 250 GOSUB 41000
- 270 VTAB 16: HTAB 1: PRINT
- 272 PRINT " (C) 1981 Strategic Simulations Inc."
- 300 PRINT : PRINT "You may:"
- 304 PRINT " 1. Play the Introductory scenario ?"
- 306 PRINT " 2. Re-start a game you've saved ?"
- 308 PRINT " 3. Create a new scenario (Shipyard) ?"
- 309 PRINT " 4. Play a scenario you've created ?"
- 13925 PRINT " 5. Read last minute ERRATA ?"
- 312 PRINT "Which ?";: GOSUB 25000
- 313 IF AA$ = "5" THEN GOSUB 60000: GOTO 250
- 314 IF AA$ = "1" THEN AA$ = "INTRO-GAME": GOTO 11100
- 316 IF AA$ = "2" THEN 380
- 318 IF AA$ = "3" THEN 330
- 319 IF AA$ = "4" THEN 11000
- 320 PRINT : PRINT : PRINT "Come on you TURKEY, enter a number from 1 to 5"
- 322 GOSUB 20000
- 324 GOTO 250
- 330 PRINT : PR# 0: IN# 0: REM RUN SCENARIO MAKER
- 332 TEXT : HOME :I = FRE (0)
- 334 HTAB 9: VTAB 12: INVERSE : PRINT " LOADING SCENARIO MAKER ": NORMAL
- 335 GOTO 12000
- 336 STOP
- 380 REM
- 382 PRINT : PRINT : PRINT "Please remove the GAME disc and insert the disc with the game SAVEd on it."
- 390 PRINT : PRINT "Hit 'RETURN' when ready-";: GOSUB 25000
- 392 PRINT : PRINT : & C AT
- 400 PRINT : PRINT : PRINT "Enter NAME file saved under-": PRINT : GOSUB 25000
- 410 F0% = 1
- 500 PRINT : & READ AA$
- 512 INPUT SA: INPUT SB: INPUT SC: INPUT SD: INPUT SE: INPUT SF: INPUT SG
- 514 INPUT SH: INPUT SI: INPUT SJ: INPUT SK: INPUT SL: INPUT SM: INPUT SN: INPUT SO
- 516 INPUT SP: INPUT SQ: INPUT SR: INPUT SS: INPUT ST: INPUT SU: INPUT SV: INPUT SW
- 518 INPUT SX: INPUT SY: INPUT SZ: INPUT SA%: INPUT SB%: INPUT SC%: INPUT SD%: INPUT SE%: INPUT SF%: INPUT S9
- 520 INPUT UT: INPUT QP%: INPUT VU%: INPUT VS%
- 2573 INPUT NE%: INPUT NT%: INPUT NF%: INPUT NS%
- 3176 GOSUB 30000: REM PARAMETERS
- 530 FOR I = 0 TO UT: INPUT U$(I): NEXT
- 532 FOR I = 0 TO UT: INPUT UX(I): NEXT
- 534 FOR I = 0 TO UT: INPUT UY(I): NEXT
- 540 FOR I = 0 TO 20: INPUT WX(I): NEXT
- 542 FOR I = 0 TO 20: INPUT WY(I): NEXT
- 544 FOR I = 0 TO 20: INPUT WZ(I): NEXT
- 546 FOR I = 0 TO 20: INPUT WT%(I): NEXT
- 550 J = CO%
- 560 FOR I = 0 TO J: INPUT MO$(I): NEXT
- 562 FOR I = 0 TO J: INPUT FO$(I): NEXT
- 570 INPUT WI%: INPUT TI%
- 580 FOR I = 0 TO 19: INPUT TX(I): NEXT
- 18025 FOR I = 0 TO 19: INPUT TY(I): NEXT
- 584 FOR I = 0 TO 19: INPUT TZ%(I): NEXT
- 588 INPUT TA$: INPUT QS%: INPUT TD$
- 590 J = NS%: FOR I = 0 TO J: INPUT TB$(I): NEXT
- 592 FOR I = 0 TO J: INPUT TS$(I): NEXT
- 600 INPUT PS$: INPUT PU$: INPUT CT%: INPUT QB%
- 700 & END
- 710 IF AA$ = "Game Data" THEN QP% = 0
- 720 IF F0% = 0 THEN 1310
- 722 F0% = 0
- 730 PRINT : PRINT "Please insert the GAME disc"
- 740 PRINT : PRINT "Hit RETURN when ready ";: GOSUB 25000
- 750 FOR U = 0 TO UT
- 760 XN(U) = UX(U):YN(U) = UY(U):U$ = U$(U)
- 770 UN$ = LEFT$ (U$,1) + MID$ (U$,SI,2) + MID$ (U$,SN,3)
- 780 IF U < US% THEN 800
- 790 IF MID$ (U$,SM,3) < > "000" THEN UN$ = LEFT$ (U$,1) + MID$ (U$,SK,2) + MID$ (U$,SN,3)
- 800 UN$(U) = UN$
- 810 NEXT
- 820 PRINT : PR# 0: IN# 0
- 830 TEXT : HOME :I = FRE (0): IF QS% < > 69 THEN 900
- 840 VTAB 12: HTAB 12: INVERSE : PRINT " LOADING 'ACE' ": NORMAL
- 850 & GOTO "SOL"
- 900 VTAB 12: HTAB 10: INVERSE : PRINT " LOADING ORDERS PHASE "
- 910 HTAB 13: PRINT " SUBMARINE SIDE ": NORMAL
- 920 & GOTO "P3"
- 1310 PRINT : PRINT : PRINT "Do you wish to play against a (H)uman or against the (C)omputer ": GOSUB 25000
- 1312 GOSUB 31340
- 1320 IF AA$ = "H" THEN 1350
- 1330 IF AA$ = "C" THEN QS% = 69: GOSUB 40000: GOTO 1350
- 1332 PRINT : PRINT "Please enter a 'C' or an 'H'": GOSUB 20180: GOTO 1310
- 1350 PRINT : PRINT "Do you wish to play a (D)ay or a (N)ight scenario ";: GOSUB 25000
- 1360 IF AA$ = "D" OR AA$ = "N" THEN TD$ = AA$: GOTO 1372
- 1370 PRINT : PRINT "Only 'D N' allowed": GOSUB 20180: GOTO 1350
- 1372 PRINT : PRINT "Do you wish the 'BEGINNER'S OPTION' (See ERRATA) ": PRINT "Enter Y if Yes ";: GOSUB 25000: IF AA$ = "Y" THEN QB% = 69
- 1380 IF QS% < > 69 THEN GOSUB 42000
- 10200 PRINT : PR# 0: IN# 0
- 10210 GOSUB 17000
- 10500 TEXT : HOME :I = FRE (0)
- 10510 HTAB 5: VTAB 12: INVERSE : PRINT " LOADING INITIAL SEARCH PHASE ": NORMAL
- 10600 & GOTO "P5"
- 11000 : REM READ & SET-UP SCENARIO ***************
- 11010 PRINT : PRINT "Please remove game disc and insert the disc with the new scenario."
- 11020 PRINT : PRINT "Hit 'RETURN' when ready. ";: GOSUB 25000
- 11022 PRINT : & C AT
- 11030 PRINT : PRINT "Enter the NAME of this scenario. ": GOSUB 25000
- 11100 PRINT : & READ AA$
- 11112 INPUT SA: INPUT SB: INPUT SC: INPUT SD: INPUT SE: INPUT SF: INPUT SG
- 11114 INPUT SH: INPUT SI: INPUT SJ: INPUT SK: INPUT SL: INPUT SM: INPUT SN: INPUT SO
- 11116 INPUT SP: INPUT SQ: INPUT SR: INPUT SS: INPUT ST: INPUT SU: INPUT SV: INPUT SW
- 11118 INPUT SX: INPUT SY: INPUT SZ: INPUT SA%: INPUT SB%: INPUT SC%: INPUT SD%: INPUT SE%: INPUT SF%: INPUT S9
- 11120 INPUT UT: INPUT NE%: INPUT NT%: INPUT NF%: INPUT NS%
- 11130 GOSUB 30000: REM DIM'S & PARAMETERS
- 11140 FOR I = 0 TO UT: INPUT U$(I): NEXT
- 11150 FOR I = 0 TO UT: INPUT UX(I): NEXT
- 11160 FOR I = 0 TO UT: INPUT UY(I): NEXT
- 11170 INPUT TF$
- 11200 & END
- 11202 IF AA$ = "INTRO-GAME" THEN 1310
- 11210 PRINT : PRINT "Please insert the game disc."
- 11220 PRINT : PRINT "Hit 'RETURN' when ready. ";: GOSUB 25000
- 11300 GOTO 1310
- 12000 REM POKE THE SHIT OUT OF THIS THING *************
- 12050 POKE 2048,0: & RUN "P1A",2049
- 17000 REM GARBAGE **
- 17030 PRINT : PR# 0: IN# 0
- 17040 TEXT : HOME
- 17070 PRINT : & RECALL "MODULE.TWO.D"
- 17080 CALL RESET%: CALL CRNCH%: CALL CRNCH%
- 17999 RETURN
- 20000 IF Q9% < > 0 THEN RETURN
- 20002 FOR LM = 1 TO 2: FOR X1 = 1 TO 50: NEXT
- 20004 FOR X2 = 1 TO 6:XA = PEEK ((X2 - 1) * 2 + 2114):XB = PEEK ((X2 - 1) * 2 + 2115): GOSUB 175: NEXT
- 20006 NEXT
- 20010 RETURN
- 20040 IF Q9% < > 0 THEN RETURN
- 20042 FOR LM = 1 TO 2: FOR X1 = 1 TO 50: NEXT
- 20044 FOR X2 = 1 TO 7:XA = PEEK ((X2 - 1) * 2 + 2100):XB = PEEK ((X2 - 1) * 2 + 2101): GOSUB 175: NEXT
- 20046 NEXT
- 20050 RETURN
- 20080 IF Q9% < > 0 THEN RETURN
- 20082 FOR LM = 1 TO 2: FOR X1 = 1 TO 50: NEXT
- 20084 FOR X2 = 1 TO 6:XA = PEEK ((X2 - 1) * 2 + 2476):XB = PEEK ((X2 - 1) * 2 + 2477): GOSUB 175: NEXT
- 20088 NEXT
- 20090 RETURN
- 20180 IF Q9% < > 0 THEN 20195
- 20181 FOR LM = 1 TO 25
- 20182 POKE 16384,200: POKE 16385,6: CALL 16386
- 20184 POKE 16384,175: POKE 16385,2: CALL 16386
- 20186 NEXT LM
- 20190 RETURN
- 20195 FOR LM = 0 TO 1000: NEXT
- 20197 RETURN
- 25000 J = 1:AA$ = "": POKE 16384,27: POKE 16385,5: CALL 16386
- 25005 K = 1
- 25006 I = PEEK ( - 16384): IF I > 127 THEN 25017
- 25007 INVERSE : PRINT " "; CHR$ (8);: NORMAL
- 25008 K = K + 1: IF K < 10 THEN 25006
- 25010 K = 1
- 25013 I = PEEK ( - 16384): IF I > 127 THEN 25017
- 25014 PRINT " "; CHR$ (8);
- 25015 K = K + 1: IF K < 5 THEN 25013
- 25016 GOTO 25005
- 25017 POKE - 16368,0:I = I - 128:C$ = CHR$ (I)
- 25018 IF C$ = CHR$ (13) THEN 25035
- 25019 PRINT C$;
- 25020 IF C$ = CHR$ (8) THEN 25040
- 25025 AA$ = AA$ + C$: IF J > 20 THEN 25000
- 25030 J = J + 1: GOTO 25005
- 25035 PRINT " ";: RETURN
- 25040 J = J - 1: IF J < 2 THEN 25000
- 25045 NORMAL : PRINT " "; CHR$ (8);:AA$ = LEFT$ (AA$,J - 1): HTAB ( POS (0)): GOTO 25005
- 30000 REM SHIP TABLES *****************
- 30020 DIM U$(UT),UX(UT),UY(UT),XN(UT),YN(UT)
- 30500 REM NE% = # OF ESCORTS
- 30502 UE% = 0: REM U$ IDX TO 1ST ESCORT
- 30510 REM NT% = # OF TANKERS
- 30512 UT% = NE%: REM U$ IDX TO 1ST TANKER
- 30520 REM NF% = # OF FREIGHTERS
- 30522 UF% = UT% + NT%
- 30530 REM NS% = # OF SUBS
- 30532 US% = UF% + NF%
- 30600 DIM MO$(NE% + NS%),FO$(NE% + NS%),FS$(NE% + NS%): REM MOVE & FIRE ORDERS
- 30602 DIM TU%(NE% + NS%): REM TIME USED FOR EACH ORDER
- 30610 CO% = NE% + NS%: REM IDX TO O$ FOR CONVOY
- 31200 REM DEPTH CHARGE DATA
- 31210 DIM WX(20),WY(20),WZ(20),WT%(20)
- 31300 REM TORPEDO DATA ********************
- 31310 DIM TX(20),TY(20),TZ%(20)
- 31320 TA$ = "0000000000000000000000": REM TIMES FOR 19 TORPEDOES
- 31330 DIM TB$(NS%),TS$(NS%)
- 31331 GOTO 32000
- 31340 A = NS% - 1
- 31350 FOR I = 0 TO A
- 31360 J = I + US%:B = VAL ( MID$ (U$(J),SD%,1)):S = VAL ( MID$ (U$(J),SE%,1))
- 31370 A$ = "X X":TB$(I) = A$:TS$(I) = A$
- 31380 K = B: GOSUB 31800:TB$(I) = A$:K = S:A$ = TS$(I): GOSUB 31800:TS$(I) = A$
- 31390 NEXT
- 31400 RETURN
- 31800 J = 1: IF K = 0 THEN RETURN : REM K=# OF TUBES TO LOAD
- 31810 A$ = LEFT$ (A$,J) + "L" + RIGHT$ (A$,10 - J)
- 31820 J = J + 1: IF J < = K THEN 31810
- 31830 RETURN
- 32000 REM UN$ STRING ************
- 2573 } REM 1=GRAPHICS ID
- 32020 REM 2-3=CURRENT SPEED
- 32030 REM 4-6=CURRENT DIRECTION
- 32100 DIM UN$(UT)
- 39999 RETURN
- 40000 UU = US% - 1:X = 0:Y = 0:Y0 = 0: REM SOL SET-UP **
- 40010 FOR U = 0 TO UU
- 40012 IF UX(U) = 69000 THEN 40050
- 40020 IF UX(U) > X THEN X = UX(U)
- 40030 IF UY(U) > Y THEN Y = UY(U)
- 40040 IF UY(U) < Y0 THEN Y0 = UY(U)
- 40050 NEXT
- 40100 UU = US%
- 40110 FOR U = UU TO UT
- 40112 U$(U) = LEFT$ (U$(U),SN - 1) + "270" + RIGHT$ (U$(U),S9 - SN - 2)
- 40120 D = 1000 * RND (1):UX(U) = X + 2000 + D
- 40130 Y1 = Y + 1000 + 500 * RND (1): IF RND (1) > .5 THEN Y1 = Y0 - 1000 - 500 * RND (1)
- 40140 UY(U) = Y1 * RND (1)
- 40150 NEXT
- 40200 RETURN
- 41000 FOR I = 0 TO 2000: NEXT : VTAB 10
- 41010 PRINT CHR$ (3);"0": PRINT CHR$ (2);"0"
- 41020 PRINT CHR$ (12): VTAB 4
- 41030 PRINT CHR$ (5): PRINT CHR$ (3);"2"
- 41032 FOR I = 0 TO 3: PRINT CHR$ (9);: NEXT
- 41040 PRINT "TORPEDO FIRE"
- 41090 PRINT CHR$ (18): PRINT CHR$ (3);"9"
- 41100 RETURN
- 42000 PRINT CHR$ (12)
- 42010 PRINT "Surface side turn away": PRINT
- 42020 PRINT "Sub side enter 2 letter PASSWORD ";: GOSUB 25000:A = LEN (AA$): IF A < > 2 THEN 42000
- 42030 PU$ = AA$: PRINT CHR$ (12)
- 42040 PRINT "Sub side turn away"
- 42050 PRINT : PRINT "Surface side enter 2 letter PASSWORD ";: GOSUB 25000:A = LEN (AA$): IF A < > 2 THEN PRINT CHR$ (12): GOTO 42040
- 42060 PS$ = AA$: RETURN
- 60000 PRINT CHR$ (12)
- 60010 PRINT "* BEGINEER'S OPTION - If an underwater weapon (DC,AT or K-Gun) detonates within 250 yards of a sub then:"
- 60020 PRINT " 1. Damage is caused if the X,Y distance is less than 75 yards and the depth differential is less than 75 feet."
- 60030 PRINT " 2. The X,Y distance is displayed during the COMPUTER ACTIVITY PHASE."
- 60040 PRINT "* 6.21 Ahead-Throw weapons sink at a rate of 10 feet per second. If a sub's";
- 60050 PRINT " X,Y is within 50 yards and the depth differential is within 50 feet then the charge detonates. It will automatically detonate when 1000 feet underwater."
- 60090 VTAB 24: HTAB 1: PRINT "Hit RETURN to continue. ";: GOSUB 25000: RETURN
- REM PROG = P1A
- 4 I = FRE (0)
- 69 PI = 3.14159
- 70 GOTO 10000
- 1000 HOME : PRINT "MAP OF 500 YARD SQUARES"
- 1200 FOR U = 0 TO UT
- 1210 I = 10 - UY(U) / 500: IF I < 1 OR I > 20 THEN 1230
- 1212 J = 20 + UX(U) / 500: IF J < 1 OR J > 40 THEN 1230
- 1220 VTAB I: HTAB J: PRINT MID$ (U$(U),SB,1)
- 1230 NEXT
- 1240 RETURN
- 10000 TEXT : HOME :I = FRE (0): REM MAIN **
- 10020 VTAB 12: HTAB 12: INVERSE : FLASH
- 10030 PRINT " S S I SHIPYARD "
- 10040 NORMAL : VTAB 18: PRINT "YOU MAY": PRINT : PRINT " 1. CREATE A NEW SCENARIO": PRINT " 2. MODIFY AN EXISTING SCENARIO": PRINT : PRINT "WHICH ";: INPUT A$
- 10050 IF A$ = "1" THEN 10100
- 10060 IF A$ = "2" THEN 40000
- 10070 PRINT "ONLY '1 2' ALLOWED": GOSUB 52000: GOTO 10000
- 10100 GOSUB 11000: REM SET UP
- 10110 GOSUB 51000: REM GET INIT DATA
- 34826 ' GOSUB 22000: REM SET UP CLASS
- 52746 ' TEXT : HOME
- 55306 ' GOSUB 13000: REM MENU CONTROL
- 15370 ( TEXT : HOME
- 17930 ( PRINT "DO YOU WISH TO WRITE THE FILE NOW ?"
- 20490 ( PRINT : PRINT "ENTER Y/N ";: INPUT A$
- 23050 ( IF A$ = "N" THEN 10200
- 25610 ( IF A$ < > "Y" THEN GOSUB 52000: GOTO 10300
- 28170 ( GOTO 50000: REM WRITE DATA FILE
- 40970 ( GOTO 19000: REM BACK TO P1
- 63498 * GOSUB 14000: GOTO 11440: REM SET UP **
- 522 + HOME
- 11100 PRINT : PRINT "HOW MANY ESCORT SHIPS (1-9) ";: INPUT A$
- 11110 E = VAL (A$): IF E < 1 OR E > 9 THEN GOSUB 52000: GOTO 11100
- 11120 PRINT : PRINT "HOW MANY TANKERS (0-9) ";: INPUT A$
- 11130 T = VAL (A$): IF T < 0 OR T > 9 THEN GOSUB 52000: GOTO 11120
- 11140 PRINT : PRINT "HOW MANY FREIGHTERS (0-9) ";: INPUT A$
- 11150 F = VAL (A$): IF F < 0 OR F > 9 THEN GOSUB 52000: GOTO 11140
- 11160 PRINT : PRINT "HOW MANY SUBS (1-9) ";: INPUT A$
- 11170 S = VAL (A$): IF S < 1 OR S > 9 THEN GOSUB 52000: GOTO 11160
- 11200 UT = E + T + F + S - 1: IF T = 0 THEN UT = UT + 1
- 11202 IF F = 0 THEN UT = UT + 1
- 11210 DIM U$(UT),UN$(UT),UX(UT),UY(UT),XN(UT),YN(UT)
- 11250 U = 0:I = 1:A$ = "DUMMY"
- 11260 U$(U) = "2E" + STR$ (I) + A$
- 11270 U = U + 1:I = I + 1: IF I < = E THEN 11260
- 11280 I = 1
- 11290 U$(U) = "0T" + STR$ (I) + A$
- 9226 ,U = U + 1:I = I + 1: IF I < = T THEN 11290
- 11786 ,I = 1
- 14346 ,U$(U) = "1F" + STR$ (I) + A$
- 16906 ,U = U + 1:I = I + 1: IF I < = F THEN 11320
- 19466 ,I = 1
- 22026 ,U$(U) = "3S" + STR$ (I) + A$
- 24586 ,U = U + 1:I = I + 1: IF I < = S THEN 11350
- 34826 , PRINT : PRINT "(F)AST OR (S)LOW CONVOY ";: INPUT A$
- 37386 , IF A$ = "F" THEN CS$ = "12": RETURN
- 39946 , IF A$ = "S" THEN CS$ = "08": RETURN
- 42506 , PRINT "ONLY 'F S' ALLOWED": GOSUB 52000: GOTO 11400
- 11440 PRINT : PRINT "SURFACE SIDE CHOOSE NATIONALITY"
- 11450 PRINT "(A)MERICAN (B)RITISH (G)ERMAN (J)APAN"
- 11460 INPUT A$
- 11470 IF A$ = "A" OR A$ = "B" OR A$ = "G" OR A$ = "J" THEN 11490
- 11480 PRINT "ENTER 'A B G J' DUMMY": GOSUB 52000: GOTO 11440
- 11490 NS$ = A$: IF A$ = "N" THEN PRINT "NO CODE YET": STOP
- 11500 PRINT : PRINT "SUB SIDE CHOOSE NATIONALITY"
- 11510 PRINT "(A)MERICAN (B)RITISH (G)ERMAN (J)APAN"
- 11520 INPUT A$
- 2573 - IF A$ = "A" OR A$ = "B" OR A$ = "G" OR A$ = "J" THEN 11550
- 11540 PRINT "ENTER 'A B G J' DOPE": GOSUB 52000: GOTO 11500
- 11550 NU$ = A$: IF A$ = "N" THEN PRINT "NO CODE YET": STOP
- 11560 PRINT : PRINT "CHOOSE A TIME PERIOD FROM BELOW": PRINT "1) 1939 - 1941": PRINT "2) 1942 - 1943": PRINT "3) 1944 - 1945": INPUT A$
- 11570 IF A$ = "1" OR A$ = "2" OR A$ = "3" THEN 11590
- 11580 PRINT "ONLY '1 2 3' ALLOWED": GOSUB 52000: GOTO 11560
- 11590 TP$ = A$: GOSUB 15000: GOTO 11100
- 12000 VTAB 23: REM MOD SHIP DATA **
- 12020 PRINT "ENTER SHIP ID (Q=QUIT M=MAP) ";: INPUT A$
- 12030 IF A$ = "M" THEN GOSUB 1000: GOTO 12000
- 12040 IF A$ = "Q" THEN RETURN
- 12050 U = 0
- 12060 IF A$ = MID$ (U$(U),SB,2) THEN 12100
- 12070 U = U + 1: IF U < = UT THEN 12060
- 12080 GOSUB 52000: GOTO 12000
- 12100 GOSUB 60000
- 12110 INPUT A$: IF A$ = "Q" THEN 12000
- 12120 A = VAL (A$): IF A > 0 AND A < 4 THEN 12140
- 12130 GOSUB 52000: GOTO 12100
- 12140 ON A GOTO 20100,20200,20900
- 13000 GOSUB 12000
- 13010 RETURN
- 14000 REM EXPLAIN PROCESS
- 14100 TEXT : HOME
- 14110 HTAB 10: INVERSE : PRINT "SHIPYARD OVER VIEW": NORMAL
- 14120 PRINT : PRINT "1. CHOSE SIDES AND TIME PERIOD."
- 14130 PRINT : PRINT "2. PICK THE # OF SHIPS OF EACH TYPE."
- 14140 PRINT : PRINT "3. CHOSE THE CLASS OF ESCORTS AND SUBS."
- 14142 PRINT : PRINT "4. PLACE THE SHIPS ON THE MAP."
- 14150 PRINT : PRINT "5. SAVE THE FLEETS YOU'VE JUST CREATED."
- 14160 PRINT : PRINT "HIT 'RETURN' TO BEGIN";: INPUT A$: RETURN
- 15000 REM PREPAR FOR DIM ARRAYS
- 15010 HOME
- 15100 PRINT "THE COMPUTER NEEDS YOU TO CHOSE THE # OF SHIPS OF EACH OF THE 4 TYPES.": PRINT
- 15110 PRINT : PRINT "HIT 'RETURN' TO CONTINUE ";: INPUT A$
- 15120 RETURN
- 19000 HOME : REM RUN P0 **
- 19100 & RUN "P0"
- 20100 PRINT "ENTER NEW X CO-ORDINATE ";: INPUT A$: REM NEW X
- 20110 X = VAL (A$): IF X > - 20000 AND X < 20000 THEN 20130
- 20120 PRINT "X MUST BE FROM -19000 TO 19000": GOSUB 52000: GOTO 20100
- 20130 UX(U) = X:XN(U) = X: GOTO 12100
- 20200 PRINT "ENTER NEW Y CO-ORDINATE ";: INPUT A$: REM NEW Y
- 20210 Y = VAL (A$): IF Y > - 20000 AND Y < 20000 THEN 20230
- 20220 PRINT "Y MUST BE FROM -19000 TO 19000": GOSUB 52000: GOTO 20200
- 20230 UY(U) = Y:YN(U) = Y: GOTO 12100
- 20900 HOME : VTAB 5: HTAB 15: INVERSE : FLASH : PRINT " WARNING ! ": NORMAL
- 20902 VTAB 10: PRINT "THIS IS A VERY POWERFULL OPTION. IT ALLOWS YOU TO CHANGE ANY FIELD IN THE SHIP DESCRIPTION STRING. WHICH MEANS YOUCAN MAKE MISTAKES THAT WILL CAUSE THE GAME TO 'BLOW UP' AT A LATER TIME."
- 20904 VTAB 18: INVERSE : FLASH : PRINT "SSI WILL NOT BE RESPONSIBLE FOR RESULTS IF YOU USE THIS OPTION": NORMAL
- 20906 VTAB 23: PRINT "HIT 'RETURN' OR (Q)UIT ";: INPUT A$: IF A$ = "Q" THEN 12100
- 20907 GOSUB 60000
- 20908 VTAB 22: HTAB 1: PRINT "ENTER POSITION OF FIELD ";
- 20910 PRINT " ";: HTAB 25: INPUT A$: IF A$ = "Q" THEN 12100
- 20920 A = VAL (A$): IF A > 1 AND A < S9 THEN 20940
- 20930 PRINT "# MUST BE 2-51": GOSUB 52000: GOTO 12100
- 20940 PRINT "ENTER # OF CHARACTERS TO BE CHANGED ";: INPUT A$: IF A$ = "Q" THEN 12100
- 20950 B = VAL (A$): IF B > 0 AND B < 4 THEN 20970
- 20960 PRINT "BIGGEST FIELD = 3": GOSUB 52000: GOTO 12100
- 20970 IF A + B > S9 THEN PRINT "FIRST & LAST CHARACTERS NOT CHANGEABLE": GOTO 20930
- 20972 PRINT "ENTER NEW FIELD ";: INPUT A$: IF A$ = "Q" THEN 12100
- 20980 U$ = LEFT$ (U$,A - 1) + RIGHT$ (A$,B) + RIGHT$ (U$,S9 - A - B + 1)
- 20990 U$(U) = U$: GOTO 12100
- 22000 TEXT : HOME :B = 1:U = 0: REM CLASS **
- 22100 INVERSE : VTAB 10: HTAB 9: PRINT "ESCORT SELECTION PHASE": NORMAL : PRINT : PRINT "CHOSE ESCORT E";B;" FROM BELOW"
- 22110 IF NS$ = "A" THEN N = 7: GOTO 22150
- 22120 IF NS$ = "B" THEN N = 18: GOTO 22300
- 22130 IF NS$ = "G" THEN N = 22: GOTO 22400
- 22140 IF NS$ = "J" THEN N = 31: GOTO 22500
- 22145 STOP
- 22150 PRINT : PRINT " 1. BENSON": PRINT " 2. FLETCHER": PRINT " 3. FLUSH DECK": PRINT " 4. BUCKLEY": PRINT " 5. EDSALL": PRINT " 6. SUB CHASER": PRINT " 7. FRIGATE"
- 22160 PRINT : PRINT "WHICH ";: INPUT A$
- 22170 A = VAL (A$): IF A > 0 AND A < 8 THEN 22190
- 22180 PRINT "ONLY 1 THRU 7 ALLOWED": GOSUB 52000: HOME : GOTO 22100
- 22190 U$ = S$(A - 1):I = VAL ( MID$ (U$,SC,1)):J = VAL (TP$): IF J > = I THEN 22200
- 22192 GOSUB 52100: HOME : GOTO 22100
- 22200 GOSUB 53100
- 22210 U$(U) = U$:U = U + 1:B = B + 1: IF B < = E THEN HOME : GOTO 22100
- 22220 GOTO 22600
- 22300 PRINT : PRINT " 1. TRIBAL": PRINT " 2. BATTLE": PRINT " 3. BLACK SWAN": PRINT " 4. FLOWER": PRINT " 5. RIVER": PRINT " 6. LOCH"
- 22310 PRINT : PRINT "WHICH ";: INPUT A$
- 22320 A = VAL (A$): IF A > 0 AND A < 7 THEN 22340
- 22330 PRINT "ONLY 1 THRU 6 ALLOWED": GOSUB 52000: HOME : GOTO 22100
- 22340 U$ = S$(A - 1 + 12):I = VAL ( MID$ (U$,SC,1)):J = VAL (TP$): IF J > = I THEN 22350
- 22342 GOSUB 52100: HOME : GOTO 22100
- 22350 GOSUB 53100
- 22360 U$(U) = U$:U = U + 1:B = B + 1: IF B < = E THEN HOME : GOTO 22100
- 22370 GOTO 22600
- 22400 VTAB 12: PRINT "GERMAN ESCORTS ARE ALL CLASS = Z-23"
- 22402 PRINT "THE COMPUTER WILL FILL THEM IN FOR YOU"
- 22410 FOR I = 0 TO 1000: NEXT
- 22420 U$ = S$(21): GOSUB 53100
- 22430 U$(U) = U$:U = U + 1:B = B + 1: IF B < = E THEN 22420
- 22440 PRINT : PRINT "HIT 'RETURN' WHEN READY ";: INPUT A$: GOTO 22600
- 22500 PRINT : PRINT " 1. AKITSUKI": PRINT " 2. HATSUHARU": PRINT " 3. KAMIKAZE": PRINT " 4. MATSU"
- 22510 PRINT : PRINT "WHICH ";: INPUT A$
- 22520 A = VAL (A$): IF A > 0 AND A < 5 THEN 22540
- 22530 PRINT "ONLY 1 THRU 4 ALLOWED": GOSUB 52000: HOME : GOTO 22100
- 22540 U$ = S$(A - 1 + 27):I = VAL ( MID$ (U$,SC,1)):J = VAL (TP$): IF J > = I THEN 22550
- 22542 GOSUB 52100: HOME : GOTO 22100
- 22550 GOSUB 53100
- 22560 U$(U) = U$:U = U + 1:B = B + 1: IF B < = E THEN HOME : GOTO 22100
- 22600 HOME : VTAB 10: PRINT "THE COMPUTER IS PUTTING YOUR TANKERS AND FREIGHTERS IN FOR YOU"
- 22610 FOR I = 1 TO 1000: NEXT
- 22620 B = 1
- 22630 U$ = S$(N): GOSUB 53100:I = SH: GOSUB 53000
- 22640 U$(U) = U$:U = U + 1:B = B + 1: IF B < = T THEN GOTO 22630
- 22650 B = 1: IF T = 0 THEN UX(U - 1) = 69000:T = 1
- 22660 U$ = S$(N + 1): GOSUB 53100:I = SH: GOSUB 53000
- 22670 U$(U) = U$:U = U + 1:B = B + 1: IF B < = F THEN GOTO 22660
- 22672 IF F = 0 THEN UX(U - 1) = 69000:F = 1
- 22680 PRINT : PRINT "HIT 'RETURN' WHEN READY ";: INPUT A$
- 22700 B = 1
- 22702 HOME : VTAB 10: HTAB 9: INVERSE : PRINT "SUBMARINE SELECTION PHASE": NORMAL : PRINT : PRINT "CHOSE SUB S";B;" FROM BELOW"
- 22704 IF NU$ = "A" THEN 22750
- 22710 IF NU$ = "B" THEN 22900
- 22720 IF NU$ = "G" THEN 23000
- 22730 IF NU$ = "J" THEN 23300
- 22735 STOP
- 22750 PRINT : PRINT " 1. SARGO": PRINT " 2. GATO": PRINT " 3. TENCH"
- 22760 PRINT : PRINT "WHICH ";: INPUT A$
- 22770 A = VAL (A$): IF A > 0 AND A < 4 THEN 22790
- 22780 PRINT "ONLY 1 THRU 3 ALLOWED": GOSUB 52000: HOME : GOTO 22702
- 22790 U$ = S$(A - 1 + 9):I = VAL ( MID$ (U$,SC,1)):J = VAL (TP$): IF J > = I THEN 22798
- 22792 GOSUB 52100: HOME : GOTO 22702
- 22798 GOSUB 53200
- 22800 U$(U) = U$:U = U + 1:B = B + 1: IF B < = S THEN 22702
- 22810 RETURN
- 22900 VTAB 12: PRINT "BRITISH SUBS ARE ALL CLASS = S-CLASS"
- 22910 PRINT "THE COMPUTER WILL FILL THEM IN FOR YOU": FOR I = 0 TO 1000: NEXT
- 22920 U$ = S$(20): GOSUB 53200
- 22930 U$(U) = U$:U = U + 1:B = B + 1: IF B < = S THEN 22920
- 22940 PRINT : PRINT "HIT 'RETURN' WHEN READY ";: INPUT A$: RETURN
- 23000 PRINT : PRINT " 1. VII C": PRINT " 2. IX C": PRINT " 3. XXI"
- 23010 PRINT : PRINT "WHICH ";: INPUT A$
- 23020 A = VAL (A$): IF A > 0 AND A < 4 THEN 23040
- 23030 PRINT "ONLY 1 THRU 3 ALLOWED": GOSUB 52000: GOTO 22702
- 23040 U$ = S$(A - 1 + 24):I = VAL ( MID$ (U$,SC,1)):J = VAL (TP$): IF J > = I THEN 23048
- 23042 GOSUB 52100: HOME : GOTO 22702
- 23048 GOSUB 53200
- 2573 ZU$(U) = U$:U = U + 1:B = B + 1: IF B < = S THEN 22702
- 23060 RETURN
- 23300 PRINT : PRINT " 1. RO 35": PRINT " 2. RO 100": PRINT " 3. I 15": PRINT " 4. I 16": PRINT " 5. I 176"
- 23310 PRINT : PRINT "WHICH ";: INPUT A$
- 23320 A = VAL (A$): IF A > 0 AND A < 6 THEN 23340
- 23330 PRINT "ONLY 1 THRU 5 ALLOWED": GOSUB 52000: GOTO 22702
- 23340 U$ = S$(A - 1 + 33):I = VAL ( MID$ (U$,SC,1)):J = VAL (TP$): IF J > = I THEN 23348
- 23342 GOSUB 52100: HOME : GOTO 22702
- 23348 GOSUB 53200
- 23350 U$(U) = U$:U = U + 1:B = B + 1: IF B < = S THEN 22702
- 23360 RETURN
- 30000 TEXT : HOME :U$ = U$(U): REM MAIN MENU **
- 30020 N$ = MID$ (U$,SD,1)
- 30100 HTAB 15: INVERSE : PRINT "SHIPYARD MENU": NORMAL
- 30110 PRINT "NATION IS ";: IF N$ = "A" THEN PRINT "AMERICAN";: GOTO 30200
- 30120 IF N$ = "B" THEN PRINT "BRITISH";: GOTO 30200
- 30130 IF N$ = "G" THEN PRINT "GERMANY";: GOTO 30200
- 30140 IF N$ = "J" THEN PRINT "JAPAN";: GOTO 30200
- 30150 IF N$ = "N" THEN PRINT "NONE";: GOTO 30200
- 30160 FLASH : PRINT "DANGER - NATION FIELD (5) BAD": NORMAL
- 30200 VTAB 3: HTAB 1: PRINT "TIME PERIOD IS ";: IF TP$ = "1" THEN PRINT "1939 - 1941": GOTO 30300
- 30210 IF TP$ = "2" THEN PRINT "1942 - 1943 ": GOTO 30300
- 30220 IF TP$ = "3" THEN PRINT "1944 - 1945 ": GOTO 30300
- 30230 IF TP$ = "0" THEN PRINT "NONE": GOTO 30300
- 30240 STOP REM OVE THIS IF OK !!!!!!!!!
- 30300 VTAB 4: HTAB 1: PRINT " 1 2 3 4"
- 30310 VTAB 5: HTAB 1: PRINT "1234567890123456789012345678901234567890"
- 30320 VTAB 6: HTAB 1: PRINT LEFT$ (U$,40)
- 30330 VTAB 8: HTAB 1: PRINT " 5 6"
- 30340 VTAB 9: HTAB 1: PRINT "12345678901234567890"
- 30350 VTAB 10: HTAB 1: PRINT RIGHT$ (U$,S9 - 40)
- 30360 RETURN
- 40000 HOME : REM READ OLD SCENARIO **
- 40020 VTAB 2: PRINT "PLEASE INSERT THE DISC THAT HAS YOUR OLD SCENARIO"
- 40030 PRINT : PRINT "HIT 'RETURN' WHEN READY ";: INPUT A$
- 40040 PRINT : PRINT "ENTER SCENARIO NAME ";: INPUT A$
- 40100 PRINT : & READ A$
- 47143 NOTRACE INPUT SA: INPUT SB: INPUT SC: INPUT SD: INPUT SE: INPUT SF: INPUT SG
- 40130 INPUT SH: INPUT SI: INPUT SJ: INPUT SK: INPUT SL: INPUT SM: INPUT SN: INPUT SO
- 40140 INPUT SP: INPUT SQ: INPUT SR: INPUT SS: INPUT ST: INPUT SU: INPUT SV: INPUT SW
- 40150 INPUT SX: INPUT SY: INPUT SZ: INPUT SA%: INPUT SB%: INPUT SC%: INPUT SD%: INPUT SE%: INPUT SF%: INPUT S9
- 40160 INPUT UT: INPUT E: INPUT T: INPUT F: INPUT S
- 40170 FOR I = 0 TO UT: INPUT U$(I): NEXT
- 40180 FOR I = 0 TO UT: INPUT UX(I): NEXT
- 40190 FOR I = 0 TO UT: INPUT UY(I): NEXT
- 40200 INPUT B$:NS$ = LEFT$ (B$,1):NU$ = MID$ (B$,2,1):TP$ = RIGHT$ (B$,1)
- 40300 & END
- 40310 PRINT : PRINT "PLEASE REMOVE YOUR DISC AND INSERT THE GAME DISC."
- 40320 PRINT : PRINT "HIT 'RETURN' WHEN READY. ";: INPUT A$
- 40500 GOTO 10200
- 50000 TEXT : HOME : REM WRITE SCENARIO **
- 50005 & RECALL "SSI INIT"
- 50007 GOSUB 61000
- 50008 IF B$ = "Y" THEN 50040
- 50010 PRINT : PRINT "PLEASE REMOVE THE GAME DISC AND INSERT AN SSI-SAVE-GAME DISC"
- 50020 PRINT : PRINT "HIT 'RETURN' WHEN READY ";: INPUT A$
- 50040 INVERSE : PRINT : HTAB 11: PRINT " DON'T FORGET! "
- 50050 PRINT " DISC MUST NOT BE WRITE PROTECTED! "
- 50060 PRINT " THERE MUST BE 10 SECTORS AVAILABLE! ": NORMAL
- 50062 PRINT : & C AT
- 50070 PRINT : PRINT "PLEASE ENTER THE NAME FOR THIS SCENARIO."
- 38954 SPC( VTAB 24: PRINT : HTAB 15: INVERSE : PRINT " ";
- 50080 HTAB 15: INPUT A$: NORMAL
- 50090 ONERR GOTO 50200
- 50100 & DEL A$
- 50200 POKE 216,0: & DEF A$,10
- 50210 & PRINT A$
- 50212 PRINT SA: PRINT SB: PRINT SC: PRINT SD: PRINT SE: PRINT SF: PRINT SG
- 50214 PRINT SH: PRINT SI: PRINT SJ: PRINT SK: PRINT SL: PRINT SM: PRINT SN: PRINT SO
- 50216 PRINT SP: PRINT SQ: PRINT SR: PRINT SS: PRINT ST: PRINT SU: PRINT SV: PRINT SW
- 50218 PRINT SX: PRINT SY: PRINT SZ: PRINT SA%: PRINT SB%: PRINT SC%: PRINT SD%: PRINT SE%: PRINT SF%: PRINT S9
- 50220 PRINT UT: PRINT E: PRINT T: PRINT F: PRINT S
- 50230 FOR I = 0 TO UT: PRINT U$(I): NEXT
- 50240 FOR I = 0 TO UT: PRINT UX(I): NEXT
- 50250 FOR I = 0 TO UT: PRINT UY(I): NEXT
- 50260 B$ = NS$ + NU$ + TP$: PRINT B$
- 50300 & END
- 50302 PRINT : & C AT
- 50310 PRINT : PRINT "PLEASE REMOVE THE SSI-SAVE-GAME DISC AND INSERT THE GAME DISC."
- 50320 PRINT : PRINT "HIT 'RETURN' WHEN READY. ";: INPUT A$
- 50400 GOTO 10400
- 51000 A$ = "TF-SHIPS": REM READ INIT DATA **
- 45100 STEP PRINT : & READ A$
- 51200 INPUT SA: INPUT SB: INPUT SC: INPUT SD: INPUT SE: INPUT SF: INPUT SG
- 51202 INPUT SH: INPUT SI: INPUT SJ: INPUT SK: INPUT SL: INPUT SM: INPUT SN: INPUT SO
- 51204 INPUT SP: INPUT SQ: INPUT SR: INPUT SS: INPUT ST: INPUT SU: INPUT SV: INPUT SW
- 51206 INPUT SX: INPUT SY: INPUT SZ: INPUT SA%: INPUT SB%: INPUT SC%: INPUT SD%: INPUT SE%: INPUT SF%: INPUT S9
- 2573 + INPUT TS
- 51220 DIM S$(TS)
- 51230 FOR I = 0 TO TS: INPUT S$(I): NEXT
- 51300 & END
- 51310 RETURN
- 52000 INVERSE : FLASH : PRINT : PRINT "ILLEGAL ENTRY"
- 52010 FOR I = 1 TO 3000: NEXT
- 13357 / NORMAL : RETURN
- 52100 PRINT "NOT AVAILABLE YET": GOSUB 52000: RETURN
- 53000 REM FIX STRING USING U$,I,J **
- 53010 U$ = LEFT$ (U$,I - 1) + A$ + RIGHT$ (U$,S9 - I - J + 1)
- 53020 RETURN
- 53100 REM FIX ESCORT STRINGS **
- 53110 A$ = STR$ (B):I = SB + 1:J = 1: GOSUB 53000
- 53120 A$ = CS$:I = SI:J = 2: GOSUB 53000
- 53130 RETURN
- 53200 REM FIX STRINGS FOR SUBS **
- 53210 A$ = STR$ (B):I = SB + 1:J = 1: GOSUB 53000
- 53220 A$ = "05":I = SK:J = 2: GOSUB 53000
- 53230 RETURN
- 60000 GOSUB 30000: REM PRINT MODIFY DATA/MENU **
- 60020 U$ = U$(U)
- 60030 VTAB 13: HTAB 1: PRINT "ID="; MID$ (U$,SB,2);
- 60120 VTAB 14: HTAB 10: PRINT "1. X=";UX(U);: HTAB 25: PRINT "2. Y=";UY(U)
- 60160 VTAB 16: HTAB 10: PRINT "3. OTHER"
- 60500 VTAB 22: HTAB 1: PRINT "ENTER # OF FIELD TO CHANGE (Q=EXIT) ";
- 60510 RETURN
- 61000 REM RDOS-STUFF
- 61002 PRINT
- 61010 PRINT "DO YOU WISH TO INITIALIZE A BLANK DISC FOR SAVING SSI GAMES? ENTER (Y) IF 'YES'";: INPUT B$
- 61020 IF B$ < > "Y" THEN 61100
- 61022 PRINT : PRINT "PLEASE INSERT A SCRATCH DISC.": PRINT "HIT 'RETURN' WHEN READY TO INITIALIZE ";: INPUT AA$
- 61030 FLASH : PRINT "INITIALIZING...": NORMAL : CALL 20480: IF NOT PEEK (0) GOTO 61100
- 61040 PRINT : PRINT "ERROR !!!": PRINT : GOTO 61000
- 61100 RETURN
- 63000 REM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- 63001 PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
- REM PROG = P2
- 4 I = FRE (0):BL$ = " "
- 5 IF F0 = 1 THEN POKE - 16301,0:F0 = 0: GOTO 10000
- 6 IF QP% < > 0 THEN 30
- 2573
- 17487 E%(15),X%(15),Y%(15),SCALE%(15),XROT%(15),YROT%(15),ZROT%(15),SX%(15),SY%(15)
- 20 RESET% = 7932:CLR% = 7951:HIRES% = 7983:CRNCH% = 7737
- 30 & RECALL "MODULE.TWO.D"
- 50 CALL RESET%
- 69 PI = 3.14159
- 70 GOTO 92
- 71 UU = NE% - 1: REM RESET FSG FLAG **
- 72 FOR U = 0 TO UU
- 74 U$(U) = LEFT$ (U$(U),SJ - 1) + "N" + RIGHT$ (U$(U),S9 - SJ)
- 76 NEXT
- 78 RETURN
- 92 BL$ = " "
- 100 IF QP% < > 0 THEN TEXT : GOTO 9000
- 680 TEXT : HOME : PRINT "READING DATA"
- 700 A$ = "INTRO-GAME"
- 710 & READ A$
- 730 INPUT SA: INPUT SB: INPUT SC: INPUT SD: INPUT SE: INPUT SF: INPUT SG
- 740 INPUT SH: INPUT SI: INPUT SJ: INPUT SK: INPUT SL: INPUT SM: INPUT SN: INPUT SO
- 750 INPUT SP: INPUT SQ: INPUT SR: INPUT SS: INPUT ST: INPUT SU: INPUT SV: INPUT SW
- 760 INPUT SX: INPUT SY: INPUT SZ: INPUT SA%: INPUT SB%: INPUT SC%: INPUT SD%: INPUT SE%: INPUT SF%: INPUT S9
- 770 INPUT UT: INPUT NE%: INPUT NT%: INPUT NF%: INPUT NS%
- 780 FOR I = 0 TO UT: INPUT U$(I): NEXT
- 790 FOR I = 0 TO UT: INPUT UX(I): NEXT
- 800 FOR I = 0 TO UT: INPUT UY(I): NEXT
- 810 INPUT B$
- 890 & END
- 900 UE% = 0:UT% = 2:UF% = 3:US% = 5:CO% = NE% + NS%
- 910 FOR I = 0 TO UT
- 920 U$ = U$(I):U$ = LEFT$ (U$,SQ - 1) + "D" + RIGHT$ (U$,S9 - SQ):U$(I) = U$
- 922 A = LEN (U$): IF A < > S9 THEN STOP
- 930 NEXT
- 940 U$(5) = LEFT$ (U$(5),SQ - 1) + "S" + RIGHT$ (U$(5),S9 - SQ)
- 960 GOSUB 71
- 999 GOTO 9000
- 1000 TEXT : HOME : PRINT "X = ";: INPUT A$: IF A$ = "" THEN 1050: REM MAP **
- 1002 IF A$ = "Q" THEN RETURN
- 1010 AX = VAL (A$): PRINT "Y = ";: INPUT A$:AY = VAL (A$): IF A$ = "Q" THEN 1000
- 1020 IF AX < - 20000 OR AX > 20000 OR AY < - 20000 OR AY > 20000 THEN 1040
- 1030 GOTO 1050
- 1040 PRINT "X & Y MUST BE FROM -20000 TO 20000": GOSUB 52000: GOTO 1000
- 1050 PRINT "SCALE = ";: INPUT A$: IF A$ = "Q" THEN 1000
- 1060 IF A$ = "A" THEN AS = 100:AC = 0: GOTO 1110
- 1070 IF A$ = "B" THEN AS = 50:AC = 2: GOTO 1110
- 1080 IF A$ = "C" THEN AS = 25:AC = 2: GOTO 1110
- 1090 IF A$ = "D" THEN AS = 10:AC = 2: GOTO 1110
- 1092 IF A$ = "E" THEN AS = 5:AC = 3: GOTO 1110
- 1094 IF A$ = "F" THEN AS = 10:AC = 6: GOTO 1110
- 1100 PRINT "SCALES ARE 'A B C D E F'": GOSUB 52000: GOTO 1050
- 1110 CX = AX / AS:CY = AY / AS
- 1112 PRINT "(O)RIGINAL OR (N)EW POSITIONS";: INPUT B$: IF B$ = "Q" THEN 1000
- 1114 IF B$ = "O" OR B$ = "N" THEN 1120
- 1116 PRINT "ONLY 'O N' ALLOWED": GOSUB 52000: GOTO 1112
- 1120 FM% = 1: CALL CLR%: HGR : HCOLOR= 2: HPLOT 0,0 TO 0,0: CALL 62454: HCOLOR= 3: HPLOT 10,11 TO 261,11 TO 261,159 TO 11,159 TO 11,11
- 1126 HCOLOR= 0: FOR I = 10 TO 170 STEP 20: HPLOT 12,I TO 260,I: NEXT
- 1128 FOR I = 16 TO 260 STEP 20: HPLOT I,10 TO I,170: NEXT
- 1130 HPLOT 131,85 TO 141,95: HPLOT 141,85 TO 131,95
- 1140 FOR I = 160 TO 191: HPLOT 0,I TO 279,I: NEXT
- 1142 POKE 512,216: POKE 513,160: POKE 514,0: POKE 515,76: POKE 516,44: POKE 517,254: POKE 60,0: POKE 61,32: POKE 62,255: POKE 63,63: POKE 66,0: POKE 67,64: CALL 512
- 1144 POKE - 16302,0
- 1150 CALL CRNCH%: CALL CRNCH%
- 1152 GOSUB 2000
- 1160 FOR U = 0 TO UT
- 1170 X0 = UX(U):Y0 = UY(U):Z = VAL ( MID$ (U$(U),SN,3)): IF B$ = "O" THEN 1180
- 1174 X0 = XN(U):Y0 = YN(U):Z = VAL ( MID$ (UN$(U),4,3))
- 1180 GOSUB 8000
- 1190 NEXT
- 1192 IF LEFT$ (FU$,1) = "S" THEN X0 = FX%:Y0 = FY%:Z = FZ%:S = 3: GOSUB 8010
- 1200 POKE - 16301,0: RETURN
- 1252 VTAB 24: PRINT : PRINT "ENTER 'V' FOR VICTORY POINTS ";: INPUT A$: IF A$ < > "V" THEN RETURN
- 2000 AB = TI% - 1: IF TI% = 0 THEN RETURN : REM DISPLAY TORPS
- 2010 FOR I = 0 TO AB
- 2020 X = TX(I) / AS:X = X + 136 - CX: IF X < 10 OR X > 245 THEN 2050
- 2030 Y = TY(I) / AS:Y = 90 - Y + CY: IF Y < 11 OR Y > 170 THEN 2050
- 2040 HCOLOR= 5: HPLOT X + 3,Y TO X - 3,Y: HPLOT X,Y TO X,Y + 5
- 2042 HPLOT X + 3,Y + 1 TO X - 3,Y + 1: HPLOT X + 1,Y TO X + 1,Y + 5
- 2050 NEXT
- 2060 RETURN
- 8000 S = VAL ( LEFT$ (U$(U),1)): IF MID$ (U$(U),SQ,1) = "X" AND U > = US% THEN RETURN
- 8010 X = X0 / AS:X = X + 136 - CX: IF X < 10 OR X > 245 THEN 8080
- 8030 Y = Y0 / AS:Y = 90 - Y + CY: IF Y < 11 OR Y > 170 THEN 8080
- 8050 X%(S) = X:Y%(S) = Y:CODE%(S) = 1:SCALE%(S) = AC:ZROT%(S) = ABS ((Z / 13.3333) - 28): POKE - 16302,0: CALL CRNCH%: CALL CRNCH%
- 8080 X%(S) = 0:Y%(S) = 0:CODE%(S) = 0:SCALE%(S) = 0:ZROT%(S) = 0
- 8090 POKE - 16301,0: RETURN
- 9000 FOR U = 0 TO UT: REM INIT UN$ **
- 9010 U$ = U$(U):UN$(U) = LEFT$ (U$,1) + MID$ (U$,SI,2) + MID$ (U$,SN,3)
- 9011 IF U < US% THEN 9020
- 9012 IF MID$ (U$,SM,3) < > "000" THEN UN$(U) = LEFT$ (U$,1) + MID$ (U$,SK,2) + MID$ (U$,SN,3)
- 9020 XN(U) = UX(U):YN(U) = UY(U)
- 9030 NEXT
- 9040 GOSUB 53000
- 9050 FOR I = 0 TO 9:SX(I) = 0:SY(I) = 0: NEXT :UU = US%
- 9052 FOR U = UU TO UT
- 9054 L0 = 200 * ( RND (1) + .5): IF RND (1) > .5 THEN L0 = - L0
- 9056 J = U - US%:SX(J) = INT ((UX(U) + L0) / 100) * 100:SY(J) = INT ((UY(U) + L0) / 100) * 100
- 9058 NEXT
- 9060 J = NE% - 1
- 9070 FOR I = 0 TO J:U$(I) = LEFT$ (U$(I),SJ - 1) + "N" + RIGHT$ (U$(I),S9 - SJ): NEXT
- 10000 HOME : VTAB 24:I = FRE (0)
- 10110 PRINT "(M)AP (S)TATUS (O)RDERS (GA)ME OVER": PRINT "(E)ND THIS TURN ";: INPUT A$
- 10150 IF A$ = "S" THEN FM% = 0: GOSUB 12000: GOSUB 12510: VTAB 22: GOTO 10110
- 10200 IF A$ = "M" THEN GOSUB 1000: GOTO 10000
- 10300 IF A$ = "O" THEN GOSUB 20000: GOTO 10000
- 10400 IF A$ = "E" THEN FM% = 0: GOTO 19000
- 10410 IF A$ = "GA" THEN 19500
- 10500 PRINT : PRINT "ONLY 'M S O GA' ARE ALLOWED": GOSUB 52000: GOTO 10000
- 12000 VTAB 24: PRINT "ENTER SHIP ID FOR STATUS ";: INPUT A$:U = 0: IF A$ = "Q" THEN RETURN
- 12130 IF MID$ (U$(U),SB,2) = A$ AND UX(U) < > 69000 THEN 12190
- 12140 U = U + 1: IF U < US% THEN 12130
- 12150 PRINT : PRINT "NO SUCH SHIP": GOSUB 52000: GOTO 12000
- 12190 U$ = U$(U): TEXT
- 12200 HOME : HTAB 15: INVERSE : PRINT " STATUS REPORT ": NORMAL
- 12210 VTAB 3: HTAB 1: PRINT "SHIP MAP-POSITION DAMAGE PTS"
- 12220 VTAB 4: HTAB 2: PRINT "ID";: HTAB 6: PRINT "X";:: HTAB 13: PRINT "Y";: HTAB 19: PRINT "KN DIR START NOW TURN"
- 12230 VTAB 5: PRINT " "; MID$ (U$,SB,2);: HTAB 6: PRINT INT (UX(U));: HTAB 13: PRINT INT (UY(U));: HTAB 19: PRINT MID$ (U$,SI,2);: HTAB 22: PRINT MID$ (U$,SN,3);
- 12232 HTAB 29: PRINT MID$ (U$,SU,2);: HTAB 33: PRINT MID$ (U$,SV,2);: HTAB 38: PRINT QP%
- 12240 PRINT : PRINT "SHIP MAX"
- 12242 PRINT "CLASS KN"
- 12244 HTAB 2: PRINT MID$ (U$,SE,2);" "; MID$ (U$,SH,2)
- 12300 VTAB 10: HTAB 10: INVERSE : PRINT " SUB(S) SPOTTED ": NORMAL
- 12310 PRINT "X Y DEPTH BY"
- 12320 UU = US%:J = 0
- 12330 FOR I = UU TO UT
- 12332 IF UX(I) = 69000 THEN 12410
- 12340 IF MID$ (U$(I),SQ,1) = "X" THEN 12410
- 12342 X = SX(I - US%):Y = SY(I - US%)
- 12350 PRINT X;: HTAB 10: PRINT Y;
- 12360 HTAB 20:P = VAL ( MID$ (U$(I),SM,3)): IF P = 0 THEN PRINT "SURFACE";:J = 1: GOTO 12390
- 12370 IF P > 30 THEN PRINT "U/W";:J = 1: GOTO 12390
- 12372 IF MID$ (U$(I),SQ,1) = "S" THEN PRINT "U/W";:J = 1: GOTO 12390
- 12380 PRINT "PERISCOPE";:J = 1
- 12390 HTAB 30:C$ = MID$ (U$(I),SQ,1): IF C$ = "D" OR C$ = "N" THEN PRINT "VISUAL": GOTO 12410
- 12392 IF C$ = "R" THEN PRINT "RADAR": GOTO 12410
- 12394 IF C$ = "S" THEN PRINT "SONAR"
- 12399 IF C$ < > "S" THEN STOP
- 12410 NEXT
- 12420 IF LEFT$ (FU$,1) < > "S" THEN 12490
- 12430 PRINT FX%;: HTAB 10: PRINT FY%;:J = 1
- 12440 HTAB 20: IF FU$ = "SR" THEN PRINT "SURFACE";: HTAB 30: PRINT "RADAR"
- 12450 IF FU$ = "SS" THEN PRINT "U/W";: HTAB 30: PRINT "SONAR"
- 12490 IF J = 0 THEN PRINT "NO SUBS SPOTTED"
- 12500 PRINT :: PRINT : IF U < NE% THEN GOSUB 23120: GOTO 12504
- 12502 AB = U:U = CO%: GOSUB 23120:U = AB
- 12504 RETURN
- 12510 IF QS% < > 69 THEN RETURN
- 12520 PRINT : PRINT "ENTER 'V' FOR VICTORY POINTS ";: INPUT A$: IF A$ < > "V" THEN RETURN
- 12530 PRINT "SURFACE = ";VS%;" SUB = ";VU%
- 12540 PRINT : PRINT "HIT 'RETURN' TO CONTINUE ";: INPUT A$: RETURN
- 12900 FOR I = 20 TO 24: VTAB I: HTAB 1: PRINT BL$;: NEXT
- 12910 VTAB 21: HTAB 1: RETURN
- 19000 REM CHAIN **
- 19010 TEXT : HOME :I = FRE (0)
- 19100 VTAB 12: HTAB 4: INVERSE : PRINT " LOADING COMPUTER ACTIVITY PHASE ": NORMAL
- 19200 & GOTO "P4"
- 19500 TEXT : HOME
- 19510 VTAB 12: HTAB 10: INVERSE : PRINT " LOADING FINAL PHASE ": NORMAL
- 19520 & GOTO "PGA"
- 20000 HOME : VTAB 24: PRINT "ENTER ID OF SHIP TO BE GIVEN ORDERS ": PRINT "('Q' = QUIT) ";: INPUT A$: IF A$ = "Q" THEN RETURN
- 20020 IF A$ = "C" THEN GOTO 20100
- 20030 U = 0
- 20040 IF MID$ (U$(U),SB,2) = A$ AND UX(U) < > 69000 THEN U$ = U$(U): GOTO 21000
- 20050 U = U + 1: IF U < UT% THEN 20040
- 20060 PRINT : PRINT "YOU CAN'T GIVE ORDERS TO THAT SHIP!": GOSUB 52000: GOTO 20000
- 20100 IF QP% < CT% THEN PRINT "NO CONVOY ORDER UNTILL TURN ";CT%: GOSUB 52000: GOTO 20000
- 20110 PRINT : PRINT : PRINT : PRINT "MOVE ORDERS =";MO$(CO%): PRINT "ENTER MOVEMENT ORDER (SEC. 4.1) ";: INPUT A$: IF A$ = "Q" THEN 20000
- 20122 A = LEN (A$):B$ = LEFT$ (A$,3): IF A < > 5 THEN PRINT : PRINT "BAD FORMAT": GOSUB 52000: GOTO 20100
- 20124 MO$(CO%) = ""
- 20130 IF B$ = "MDP" OR B$ = "MDS" THEN 20400
- 20140 IF B$ = "MDC" THEN MO$(CO%) = "MDC60": GOTO 20500
- 20150 IF LEFT$ (A$,2) = "MC" THEN 20300
- 20160 A$ = A$ + A$: GOTO 20122
- 20300 C$ = A$:M$ = A$:B$ = "":D$ = "":U$ = U$(UT%):UN$ = LEFT$ (UN$(UT%),3) + MID$ (U$(UT%),SN,3): GOSUB 28000
- 20310 MO$(CO%) = LEFT$ (M$,5):A = LEN (M$): IF A = 5 THEN 20500
- 20320 IF MID$ (M$,6,2) = "MX" THEN MO$(CO%) = LEFT$ (M$,10)
- 20330 GOTO 20500
- 20400 GOSUB 29000
- 20410 I = INT (I / 10):B$ = "00" + STR$ (I):MO$(CO%) = LEFT$ (A$,3) + RIGHT$ (B$,2)
- 20500 PRINT : PRINT : PRINT : PRINT "TO (E)XECUTE CONVOY ORDER ENTER 'E' ";: INPUT A$: IF A$ < > "E" THEN 20000
- 20540 IF MO$(CO%) = "" THEN MO$(CO%) = "MDC60"
- 20542 IF MID$ (MO$(CO%),3,1) = "C" THEN NO$ = "MDC10": GOTO 20560
- 20550 NO$ = LEFT$ (MO$(CO%),3) + "01"
- 20560 UU = US% - 1:CU = UT%
- 20562 FOR U = CU TO UU:XN(U) = UX(U):YN(U) = UY(U): NEXT
- 20570 FOR U = CU TO UU
- 20580 TL = 60:UN$ = LEFT$ (UN$(U),3) + MID$ (U$(U),SN,3):UN$(U) = UN$
- 20590 IF MID$ (UN$(U),2,2) < > "00" THEN GOSUB 40000
- 20600 TL = TL - I: IF TL > 0 THEN 20590
- 20610 NEXT
- 20620 GOTO 20000
- 21000 GOSUB 23000: PRINT "DO YOU WISH TO ENTER A (M)OVE OR (F)IRE ORDER, (E)XECUTE THESE ORDERS OR (Q)UIT": INPUT A$: IF A$ = "Q" THEN 20000
- 21030 IF A$ = "M" THEN 21100
- 21040 IF A$ = "F" THEN 22000
- 21050 IF A$ = "E" THEN 30000
- 21070 PRINT "ONLY 'M F E Q' ALLOWED": GOSUB 52000: GOTO 21000
- 21100 GOSUB 23100: PRINT "(N)EW, (A)DD OR (Q)UIT ";: INPUT A$: IF A$ = "Q" THEN 21000
- 21140 IF A$ = "N" THEN MO$(U) = "": GOTO 21200
- 21150 IF A$ = "A" THEN 21200
- 21160 PRINT "ONLY 'N A Q' ALLOWED": GOSUB 52000: GOTO 21100
- 21200 GOSUB 23100: PRINT "ENTER MOVEMENT ORDER (SEC. 4.1)";: INPUT A$: IF A$ = "Q" THEN 21000
- 21222 I = LEN (A$): IF I < > 5 THEN 21250
- 21230 IF LEFT$ (A$,3) = "MSS" THEN 21260
- 21240 IF LEFT$ (A$,2) = "MD" THEN 21400
- 21242 IF LEFT$ (A$,2) = "MC" THEN 21500
- 21250 PRINT "BAD FORMAT": GOSUB 52000: GOTO 21200
- 21260 I = VAL ( RIGHT$ (A$,2)): IF I < 0 THEN PRINT "CAN'T GO BACKWARDS": GOSUB 52000: GOTO 21200
- 21270 J = VAL ( MID$ (U$,SH,2)):K = J / 3: IF I < = J THEN 21280
- 21274 PRINT : PRINT "CAN'T EXCEED MAX SPEED": GOSUB 52000: GOTO 21200
- 21280 A = LEN (MO$(U)):B = 1:X = 0
- 21282 IF MID$ (MO$(U),B,3) = "MSS" THEN X = 1
- 21284 B = B + 5: IF B < = (A) THEN 21282
- 21286 IF X < > 0 THEN PRINT "ONLY 1 SPEED CHANGE PER TURN": GOSUB 52000: GOTO 21200
- 21300 J = VAL ( MID$ (U$,SI,2)): IF ABS (J - I) < = K THEN 21320
- 21310 PRINT "CAN'T CHANGE SPEED THAT MUCH": GOSUB 52000: GOTO 21200
- 21320 MO$(U) = MO$(U) + A$: GOTO 21100
- 21400 IF MID$ (A$,3,1) = "C" THEN 21430
- 21410 IF MID$ (A$,3,1) = "P" OR MID$ (A$,3,1) = "S" THEN 21450
- 21420 GOTO 21250
- 21430 I = VAL ( MID$ (A$,4,2)): IF I > 9 AND I < 61 THEN 21320
- 21440 PRINT "YOU MUST ENTER 10-60 TIME POINTS": GOSUB 52000: GOTO 21200
- 21450 I = VAL ( MID$ (A$,4,2)): IF I > 0 AND I < 19 THEN 21320
- 21460 PRINT "RANGE SHOULD BE 01-18": GOSUB 52000: GOTO 21200
- 21500 A = VAL ( RIGHT$ (A$,3)): IF A > = 0 AND A < 360 THEN 21320
- 21530 PRINT "COURSE MUST BE 000 TO 359": GOSUB 52000: GOTO 21200
- 22000 GOSUB 23100: PRINT "(N)EW, (A)DD OR (Q)UIT ";: INPUT A$: IF A$ = "Q" THEN 21000
- 22030 IF A$ = "N" THEN FO$(U) = "":FS$(U) = "": GOTO 22100
- 22040 IF A$ = "A" THEN 22100
- 22050 PRINT "ONLY 'N A Q' ALLOWED": GOSUB 52000: GOTO 22000
- 22100 GOSUB 23100: PRINT "ENTER FIRE ORDER (SEC. 4.2) ";: INPUT A$: IF A$ = "Q" THEN 21000
- 22110 B$ = LEFT$ (A$,3): IF B$ = "FSG" OR B$ = "FSS" THEN 22600
- 22130 A = LEN (A$): IF A < > 7 THEN 22190
- 22140 I = VAL ( MID$ (A$,4,1)): IF I < 7 THEN 22160
- 22150 PRINT "TIME MUST BE 0-6": GOSUB 52000: GOTO 22100
- 22160 IF B$ = "FDC" THEN 22200
- 22170 IF B$ = "FKG" THEN 22300
- 22180 IF B$ = "FAT" THEN 22400
- 22190 PRINT "BAD FORMAT": GOSUB 52000: GOTO 22100
- 22200 I = VAL ( RIGHT$ (A$,3)): IF I > 25 THEN 22220
- 22210 PRINT "ILLEGAL DEPTH SETTING": GOSUB 52000: GOTO 22100
- 22220 GOTO 22800
- 22300 I = VAL ( RIGHT$ (A$,3)): IF I > 25 THEN 22800
- 22310 PRINT "ILLEGAL DEPTH SETTING": GOSUB 52000: GOTO 22100
- 22400 I = VAL ( RIGHT$ (A$,3)): IF I > 99 AND I < 201 THEN 22800
- 22410 PRINT "ILLEGAL DISTANCE": GOSUB 52000: GOTO 22100
- 22600 A = LEN (A$): IF A < > 10 THEN 22190
- 22610 I = VAL ( MID$ (A$,4,3)): IF I > = 0 AND I < 360 THEN 22630
- 22620 PRINT "COURSE MUST BE 000 TO 359": GOSUB 52000: GOTO 22100
- 22630 J = VAL ( RIGHT$ (A$,4)): IF J > 0 THEN 22650
- 22640 PRINT "DISTANCE MUST BE POSITIVE": GOSUB 52000: GOTO 22100
- 22650 X = 0:Y = 0:K = NE% + NS%:A = 1:B$ = FS$(U):B = LEN (B$)
- 22660 IF MID$ (U$,SJ,1) = "Y" THEN X = X + 1
- 22670 IF MID$ (B$,A,3) = "FSS" THEN Y = Y + 1
- 22680 A = A + 10: IF A < B THEN 22660
- 22690 IF LEFT$ (A$,3) = "FSG" AND X > 0 THEN PRINT "ONLY 1 'FSG' ALLOWED (SEE ERRATA)": GOSUB 52000: GOTO 22100
- 22700 IF LEFT$ (A$,3) = "FSS" AND Y > 1 THEN PRINT "ONLY 2 'FSS'S ALLOWED": GOSUB 52000: GOTO 22100
- 22710 I = VAL ( MID$ (U$,SW,2)): IF I < 1 THEN PRINT "SHIP DOESN'T HAVE GUNS": GOSUB 52000: GOTO 22100
- 22712 IF LEFT$ (A$,3) = "FSG" THEN U$ = LEFT$ (U$,SJ - 1) + "Y" + RIGHT$ (U$,S9 - SJ):U$(U) = U$
- 22720 FS$(U) = FS$(U) + A$: GOTO 22000
- 22800 X = 0:Y = 0:Z = 0:F$ = FO$(U) + A$:A = LEN (F$):B = 1: REM CHECKDC'S VS FDC'S,ETC **
- 22810 IF MID$ (F$,B,3) = "FDC" THEN X = X + 1
- 22820 IF MID$ (F$,B,3) = "FKG" THEN Y = Y + 1
- 22830 IF MID$ (F$,B,3) = "FAT" THEN Z = Z + 1
- 22840 B = B + 7: IF B < = (A) THEN 22810
- 22850 I = VAL ( MID$ (U$,SZ,1)): IF X > I THEN 22900
- 22860 I = VAL ( MID$ (U$,SY,1)): IF Y > I THEN 22900
- 22870 I = VAL ( MID$ (U$,SA%,1)): IF Z > I THEN 22900
- 22880 FO$(U) = F$: GOTO 22000
- 22900 PRINT LEFT$ (A$,3);" LIMIT = ";I: GOSUB 52000: GOTO 22100
- 23000 GOSUB 12200: GOSUB 12900: REM DATA LINE **
- 23010 PRINT MID$ (U$,SB,2);" X="; INT (XN(U));" Y="; INT (YN(U));" KN="; MID$ (UN$(U),2,2);" DIR="; MID$ (UN$(U),4,3)
- 23020 RETURN
- 23100 GOSUB 12900: IF U > NE% - 1 THEN RETURN
- 23110 PRINT MID$ (U$,SB,2);" X="; INT (XN(U));" Y="; INT (YN(U));" KN="; MID$ (UN$(U),2,2);" DIR="; MID$ (UN$(U),4,3)
- 23120 PRINT "MOVE ORDERS = ";MO$(U): PRINT "FIRE ORDERS = ";FO$(U): IF FS$(U) < > "" THEN PRINT " AND = ";FS$(U)
- 23130 RETURN
- 28000 IF LEFT$ (M$,2) < > "MC" THEN RETURN : REM MCNNN **
- 28012 A = LEN (M$): IF A = 5 THEN M$ = "": GOTO 28020
- 28014 M$ = RIGHT$ (M$,A - 5)
- 28020 D0 = VAL ( RIGHT$ (UN$,3)):D = VAL ( MID$ (C$,3,3))
- 28022 GOTO 28500
- 28030 GOSUB 29000
- 28090 K = 0:D$ = ""
- 28100 K = K + 10: IF K > = I THEN 28130
- 28110 IF K > = J THEN 28200
- 28120 GOTO 28100
- 28130 A = INT (K / 10):B$ = "00" + STR$ (A)
- 28140 D$ = D$ + "MD" + A$ + RIGHT$ (B$,2):K = 0:J = J - I: IF J = 0 THEN 28252
- 28142 IF J < 10 THEN A = ABS (J): GOTO 28230
- 28150 GOTO 28100
- 28200 A = INT (K / 10):B$ = "00" + STR$ (A)
- 28210 D$ = D$ + "MD" + A$ + RIGHT$ (B$,2)
- 28220 A = ABS (K - J): IF A = 0 THEN 28252
- 28230 B$ = "0" + STR$ (A)
- 28240 A$ = MID$ (D$,3,1)
- 28250 D$ = D$ + "MXX" + A$ + RIGHT$ (B$,1)
- 28252 A = LEN (C$): IF A = 5 THEN C$ = "": GOTO 28260
- 28254 C$ = RIGHT$ (C$,A - 5)
- 28260 M$ = D$ + M$: RETURN
- 28500 IF D0 > D THEN A$ = "P"
- 28510 IF D0 < D THEN A$ = "S"
- 28520 J = ABS (D0 - D): IF J < 180 THEN 28030
- 28530 J = D0 + 360 - D: IF J < = 180 THEN A$ = "P": GOTO 28030
- 28540 J = D + 360 - D0: IF J < 180 THEN A$ = "S": GOTO 28030
- 28550 STOP
- 29000 A = VAL ( MID$ (U$,SG,1)): IF A < 1 OR A > 9 THEN STOP
- 29010 ON A GOTO 29011,29012,29013,29014,29015,29016,29017,29018,29019
- 29011 I = 6: GOTO 29020
- 29012 I = 18: GOTO 29020
- 29013 I = 30: GOTO 29020
- 29014 I = 60: GOTO 29020
- 29015 I = 90: GOTO 29020
- 29016 I = 120: GOTO 29020
- 29017 I = 180: GOTO 29020
- 29018 I = 360: GOTO 29020
- 29019 I = 720
- 29020 RETURN
- 30000 IF FM% = 1 THEN 30020
- 30010 UU = U: GOSUB 1000:U = UU: GOTO 30000
- 30020 I = FRE (0): VTAB 24: & GOTO "P2E"
- 34000 D0 = VAL ( RIGHT$ (UN$,3)):D = VAL ( MID$ (M$,5,1)): REM MXXJN **
- 34012 IF MID$ (M$,4,1) = "P" THEN 34020
- 34014 D0 = D0 - D:A$ = "000" + STR$ (D0): GOTO 34030
- 34020 D0 = D0 + D:A$ = "000" + STR$ (D0)
- 34030 UN$ = LEFT$ (UN$,3) + RIGHT$ (A$,3)
- 34040 A = LEN (M$):M$ = RIGHT$ (M$,A - 5)
- 34050 UN$(U) = UN$: RETURN
- 40000 UN$ = UN$(U):U$ = U$(U): REM EXECUTE MDXTT **
- 40010 Z = VAL ( MID$ (UN$,4,3)):K0 = VAL ( MID$ (UN$,2,2))
- 40020 IF MID$ (NO$,3,1) < > "C" THEN 40100
- 40030 I = VAL ( MID$ (NO$,4,2)): IF I > 10 THEN STOP
- 40040 GOTO 40200
- 40100 IF MID$ (NO$,3,1) < > "P" AND MID$ (NO$,3,1) < > "S" THEN STOP
- 40110 GOSUB 29000:A = I
- 40120 J = A / 60:I = 10 / J
- 40130 Z = Z + 10: IF MID$ (NO$,3,1) = "P" THEN Z = Z - 20
- 40140 IF Z > 360 THEN Z = Z - 360
- 54922 NOTRACE IF Z < 0 THEN Z = Z + 360
- 40200 L0 = K0 * .5555 * I:Z2 = 450 - Z: IF Z2 > = 360 THEN Z2 = Z2 - 360
- 40210 X0 = XN(U) + L0 * COS (Z2 * PI / 180)
- 40220 Y0 = YN(U) + L0 * SIN (Z2 * PI / 180)
- 40230 GOSUB 8000
- 40300 XN(U) = X0:YN(U) = Y0
- 40310 A$ = "000" + STR$ (Z)
- 40330 UN$ = LEFT$ (UN$,3) + RIGHT$ (A$,3)
- 40340 UN$(U) = UN$: RETURN
- 52000 INVERSE : FLASH : PRINT : PRINT "ILLEGAL ENTRY"
- 52010 FOR I = 1 TO 1500: NEXT
- 52020 NORMAL : RETURN
- 53000 CALL CLR%: HGR : HCOLOR= 2: HPLOT 0,0 TO 0,0: CALL 62454
- 53010 FOR I = 0 TO 3:CODE%(I) = 1: NEXT
- 53012 FOR I = 0 TO 3:SCALE%(I) = 8: NEXT
- 53020 X%(0) = 90:Y%(0) = 40
- 53030 X%(1) = 180:Y%(1) = 40
- 53040 X%(2) = 90:Y%(2) = 110
- 53050 X%(3) = 180:Y%(3) = 110
- 53058 J = 7: IF RND (1) > .5 THEN J = 21
- 53060 FOR I = 0 TO 3:ZROT%(I) = J: NEXT
- 53100 CALL CRNCH%: CALL CRNCH%
- 53102 FOR I = 0 TO 3:X%(I) = X%(I) + 1: NEXT : CALL CRNCH%: CALL CRNCH%
- 53110 POKE - 16301,0
- 53112 FOR I = 0 TO 3:CODE%(I) = 0: NEXT
- 53114 IF QS% = 69 THEN RETURN
- 53120 VTAB 23: HTAB 1: PRINT "ENTER PASSWORD ";: INPUT A$
- 53130 IF A$ = PS$ THEN RETURN
- 53140 GOSUB 52000: PRINT : PRINT : PRINT : GOTO 53000
- 62000 REM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- 62001 REM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- 62002 REM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- 62003 REM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- REM PROG = P2E
- 4 I = FRE (0)
- 30 & RECALL "MODULE.TWO.D"
- 69 PI = 3.14159
- 92 BL$ = " "
- 100 GOTO 30000
- 1000 TEXT : HOME : PRINT "X = ";: INPUT A$: IF A$ = "" THEN 1050: REM MAP **
- 1002 IF A$ = "Q" THEN RETURN
- 1010 AX = VAL (A$): PRINT "Y = ";: INPUT A$:AY = VAL (A$): IF A$ = "Q" THEN 1000
- 1020 IF AX < - 20000 OR AX > 20000 OR AY < - 20000 OR AY > 20000 THEN 1040
- 1030 GOTO 1050
- 1040 PRINT "X & Y MUST BE FROM -20000 TO 20000": GOSUB 52000: GOTO 1000
- 1050 PRINT "SCALE = ";: INPUT A$: IF A$ = "Q" THEN 1000
- 1060 IF A$ = "A" THEN AS = 100:AC = 0: GOTO 1110
- 1070 IF A$ = "B" THEN AS = 50:AC = 2: GOTO 1110
- 1080 IF A$ = "C" THEN AS = 25:AC = 2: GOTO 1110
- 1090 IF A$ = "D" THEN AS = 10:AC = 2: GOTO 1110
- 1092 IF A$ = "E" THEN AS = 5:AC = 3: GOTO 1110
- 1094 IF A$ = "F" THEN AS = 10:AC = 6: GOTO 1110
- 1100 PRINT "SCALES ARE 'A B C D E F'": GOSUB 52000: GOTO 1050
- 1110 CX = AX / AS:CY = AY / AS
- 1112 PRINT "(O)RIGINAL OR (N)EW POSITIONS";: INPUT B$: IF B$ = "Q" THEN 1000
- 1114 IF B$ = "O" OR B$ = "N" THEN 1120
- 1116 PRINT "ONLY 'O N' ALLOWED": GOSUB 52000: GOTO 1112
- 1120 CALL CLR%: HGR : HCOLOR= 2: HPLOT 0,0 TO 0,0: CALL 62454: HCOLOR= 3: HPLOT 10,11 TO 261,11 TO 261,159 TO 11,159 TO 11,11
- 1126 HCOLOR= 0: FOR I = 10 TO 170 STEP 20: HPLOT 12,I TO 260,I: NEXT
- 1128 FOR I = 16 TO 260 STEP 20: HPLOT I,10 TO I,170: NEXT
- 1130 HPLOT 131,85 TO 141,95: HPLOT 141,85 TO 131,95
- 1140 FOR I = 160 TO 191: HPLOT 0,I TO 279,I: NEXT
- 1142 POKE 512,216: POKE 513,160: POKE 514,0: POKE 515,76: POKE 516,44: POKE 517,254: POKE 60,0: POKE 61,32: POKE 62,255: POKE 63,63: POKE 66,0: POKE 67,64: CALL 512
- 1144 POKE - 16302,0
- 1150 CALL CRNCH%: CALL CRNCH%
- 1160 FOR U = 0 TO UT
- 1170 X0 = UX(U):Y0 = UY(U):Z = VAL ( MID$ (U$(U),SN,3)): IF B$ = "O" THEN 1180
- 1174 X0 = XN(U):Y0 = YN(U):Z = VAL ( MID$ (UN$(U),4,3))
- 1180 GOSUB 8000
- 1190 NEXT
- 1192 IF LEFT$ (FU$,1) = "S" THEN X0 = FX%:Y0 = FY%:Z = FZ%:S = 3: GOSUB 8010
- 1200 POKE - 16301,0: RETURN
- 8000 S = VAL ( LEFT$ (U$(U),1)): IF MID$ (U$(U),SQ,1) = "X" AND U > = US% THEN RETURN
- 8010 X = X0 / AS:X = X + 136 - CX: IF X < 10 OR X > 245 THEN 8080
- 8030 Y = Y0 / AS:Y = 90 - Y + CY: IF Y < 11 OR Y > 170 THEN 8080
- 8050 X%(S) = X:Y%(S) = Y:CODE%(S) = 1:SCALE%(S) = AC:ZROT%(S) = ABS ((Z / 13.3333) - 28): POKE - 16302,0: CALL CRNCH%: CALL CRNCH%
- 8080 X%(S) = 0:Y%(S) = 0:CODE%(S) = 0:SCALE%(S) = 0:ZROT%(S) = 0
- 39526 POKE - 16301,0: RETURN
- 19000 F0 = 1: PRINT : & GOTO "P2"
- 20000 PRINT "FOR A NEW MAP TYPE 'M' ";: INPUT A$
- 20010 IF A$ < > "M" THEN 19000
- 20020 D0 = U: GOSUB 1000: VTAB 24: HTAB 1
- 20030 PRINT "TO EXECUTE THE SAME ORDER(S) ENTER 'E'";: INPUT A$
- 20040 IF A$ < > "E" THEN 19000
- 20050 U = D0: GOTO 30000
- 28000 IF LEFT$ (M$,2) < > "MC" THEN RETURN : REM MCNNN **
- 28012 C$ = M$:A = LEN (M$): IF A = 5 THEN M$ = "": GOTO 28020
- 28014 M$ = RIGHT$ (M$,A - 5)
- 28020 D0 = VAL ( RIGHT$ (UN$,3)):D = VAL ( MID$ (C$,3,3))
- 28022 GOTO 28500
- 28030 GOSUB 29000
- 28090 K = 0:D$ = ""
- 28100 K = K + 10: IF K > = I THEN 28130
- 28110 IF K > = J THEN 28200
- 28120 GOTO 28100
- 28130 A = INT (K / 10):B$ = "00" + STR$ (A)
- 28140 D$ = D$ + "MD" + A$ + RIGHT$ (B$,2):K = 0:J = J - I: IF J = 0 THEN 28252
- 28142 IF J < 10 THEN A = ABS (J): GOTO 28230
- 28150 GOTO 28100
- 28200 A = INT (K / 10):B$ = "00" + STR$ (A)
- 28210 D$ = D$ + "MD" + A$ + RIGHT$ (B$,2)
- 28220 A = ABS (K - J): IF A = 0 THEN 28252
- 28230 B$ = "0" + STR$ (A)
- 28240 A$ = MID$ (D$,3,1)
- 28250 D$ = D$ + "MXX" + A$ + RIGHT$ (B$,1)
- 28252 A = LEN (C$): IF A = 5 THEN C$ = "": GOTO 28260
- 28254 C$ = RIGHT$ (C$,A - 5)
- 28260 M$ = D$ + M$: RETURN
- 28500 IF D0 > D THEN A$ = "P"
- 28510 IF D0 < D THEN A$ = "S"
- 28512 IF D0 = D THEN RETURN
- 28520 J = ABS (D0 - D): IF J < = 180 THEN 28030
- 28530 J = D0 + 360 - D: IF J < 180 THEN A$ = "P": GOTO 28030
- 28540 J = D + 360 - D0: IF J < 180 THEN A$ = "S": GOTO 28030
- 28550 STOP
- 29000 A = VAL ( MID$ (U$,SG,1)): IF A < 1 OR A > 9 THEN STOP
- 29010 ON A GOTO 29011,29012,29013,29014,29015,29016,29017,29018,29019
- 29011 I = 6: GOTO 29020
- 29012 I = 18: GOTO 29020
- 29013 I = 30: GOTO 29020
- 29014 I = 60: GOTO 29020
- 29015 I = 90: GOTO 29020
- 29016 I = 120: GOTO 29020
- 29017 I = 180: GOTO 29020
- 29018 I = 360: GOTO 29020
- 29019 I = 720
- 29020 RETURN
- 30000 GOSUB 35000: REM EXECUTE **
- 30010 XN(U) = UX(U):YN(U) = UY(U):C$ = MO$(U) + "MDC01":M$ = C$:F$ = FO$(U)
- 30012 U$ = U$(U):UN$(U) = LEFT$ (U$,1) + MID$ (U$,SI,2) + MID$ (U$,SN,3):UN$ = UN$(U)
- 30020 TL = 60:T = 0
- 30030 DC$ = "0000000": FOR I = 0 TO 20:DC$ = DC$ + "000000": NEXT
- 30040 DC = 2: GOSUB 28000
- 30100 IF F$ = "" THEN 31000
- 30102 GOSUB 33000
- 30110 IB = INT ((60 - TL) / 10):J = LEN (F$):AB = 1
- 30120 K = VAL ( MID$ (F$,AB + 3,1)): IF IB = K THEN 30200
- 30130 J = LEN (F$):AB = AB + 7: IF AB < J THEN 30120
- 30140 GOTO 31000
- 30200 Z = VAL ( MID$ (UN$,4,3)):NO$ = MID$ (F$,AB,7)
- 30210 IF LEFT$ (NO$,2) < > "FD" THEN 30300
- 30220 Z1 = Z + 180
- 5740 v IF Z1 > 360 THEN Z1 = Z1 - 360
- 30238 Z2 = 450 - Z1: IF Z2 = 360 THEN Z2 = 0
- 30240 X = XN(U) + 60 * COS (Z2 * PI / 180)
- 30250 Y = YN(U) + 60 * SIN (Z2 * PI / 180)
- 30260 GOSUB 30700
- 30270 GOTO 30900
- 30300 IF LEFT$ (NO$,2) < > "FA" THEN 30400
- 30310 J = VAL ( MID$ (NO$,5,3)) + 50:Z2 = 450 - Z: IF Z2 = 360 OR Z2 = 180 THEN Z2 = 0
- 30320 X = XN(U) + J * COS (Z2 * PI / 180)
- 30330 Y = YN(U) + J * SIN (Z2 * PI / 180)
- 30340 GOSUB 30700: GOTO 30900
- 30400 IF LEFT$ (NO$,2) < > "FK" THEN STOP
- 30402 J = Z + 90: IF J > 360 THEN J = J - 360
- 30404 Z2 = 450 - J: IF Z2 = 360 THEN Z2 = 0
- 30410 X = XN(U) + 100 * COS (Z2 * PI / 180)
- 30420 Y = YN(U) + 100 * SIN (Z2 * PI / 180)
- 30430 GOSUB 30700: GOSUB 30908
- 30440 J = Z - 90: IF J < 0 THEN J = J + 360
- 30450 X = XN(U) + 100 * COS ((450 - J) * PI / 180)
- 30460 Y = YN(U) + 100 * SIN ((450 - J) * PI / 180)
- 30470 GOSUB 30700: GOTO 30900
- 30700 X0 = X / AS:X0 = X0 + 136 - CX: REM PLOT + AT X,Y
- 30710 IF X0 < 10 OR X0 > 250 THEN RETURN
- 30720 Y0 = Y / AS:Y0 = 90 - Y0 + CY
- 2573 x IF Y0 < 10 OR Y0 > 170 THEN RETURN
- 30740 HCOLOR= 0: HPLOT X0 - 5,Y0 - 5 TO X0 + 5,Y0 + 5
- 30742 HPLOT X0,Y0 + 5 TO X0,Y0 - 5
- 30750 HPLOT X0 - 5,Y0 + 5 TO X0 + 5,Y0 - 5
- 30752 HPLOT X0 - 5,Y0 TO X0 + 5,Y0
- 30760 RETURN
- 30900 I = LEN (F$):F$ = LEFT$ (F$,AB + 2) + "9" + RIGHT$ (F$,I - AB - 3): REM SET T=9 IN ORDER
- 30902 GOTO 30940
- 30908 X0 = X / AS:X0 = X0 + 136 - CX: REM UPDATE DC$ **
- 30910 IF X0 < 10 OR X0 > 250 THEN RETURN
- 30912 Y0 = Y / AS:Y0 = 90 - Y0 + CY
- 30914 IF Y0 < 10 OR Y0 > 170 THEN RETURN
- 30916 I = LEN (DC$):X0 = INT (X0):Y0 = INT (Y0)
- 30918 A$ = STR$ (X0):B$ = STR$ (Y0)
- 30920 IF X0 < 100 THEN A$ = "0" + A$
- 30922 IF Y0 < 100 THEN B$ = "0" + B$
- 30924 DC$ = LEFT$ (DC$,DC - 1) + A$ + B$ + RIGHT$ (DC$,I - DC - 6)
- 30930 DC = DC + 6: RETURN
- 30940 GOSUB 30908
- 30990 GOTO 30130
- 31000 IF LEFT$ (M$,3) = "MSS" THEN GOSUB 32000: GOTO 31500
- 31002 IF LEFT$ (M$,2) = "MX" THEN GOSUB 34000: GOTO 30100
- 31004 IF LEFT$ (M$,2) = "MC" THEN GOSUB 28000: GOTO 30100
- 31010 IF LEFT$ (M$,3) < > "MDC" THEN 31300
- 31020 TI = VAL ( MID$ (M$,4,2))
- 31030 IF TI < 11 THEN 31150
- 31040 NO$ = "MDC10": GOSUB 40000
- 31050 TI = TI - 10:J = LEN (M$): IF TI < = 0 THEN 31200
- 31060 A$ = STR$ (TI)
- 31062 IF TI < 10 THEN A$ = "0" + A$
- 31064 IF J = 5 THEN 31090
- 31070 M$ = LEFT$ (M$,3) + RIGHT$ (A$,2) + RIGHT$ (M$,J - 5)
- 31080 GOTO 31100
- 31090 M$ = LEFT$ (M$,3) + RIGHT$ (A$,2)
- 31100 TL = TL - 10: GOTO 31500
- 31110 IF J = 5 THEN M$ = "": GOTO 31500
- 31150 IF TI = 10 THEN 31040
- 31160 A$ = STR$ (TI)
- 31170 NO$ = "MDC" + "0" + RIGHT$ (A$,1)
- 31172 GOSUB 40000
- 31180 TL = TL - TI: REM TL=TL-TI
- 31182 A = LEN (M$): IF A = 5 THEN M$ = "": GOTO 31500
- 31184 M$ = RIGHT$ (M$,A - 5): GOTO 31500
- 31200 IF J = 5 THEN M$ = "": GOTO 31100
- 31210 M$ = RIGHT$ (M$,J - 5): GOTO 31100
- 31300 NO$ = LEFT$ (M$,3) + "01": GOSUB 40000
- 31310 TL = TL - I
- 31340 J = VAL ( MID$ (M$,4,2)):J = J - 1:A = LEN (M$)
- 31350 IF J < > 0 THEN 31370
- 31360 IF A = 5 THEN M$ = "": GOTO 31500
- 31362 M$ = RIGHT$ (M$,A - 5): GOTO 31500
- 31370 A$ = STR$ (J): IF J < 10 THEN 31400
- 31380 IF A = 5 THEN M$ = LEFT$ (M$,3) + RIGHT$ (A$,2): GOTO 31500
- 31390 M$ = LEFT$ (M$,3) + RIGHT$ (A$,2) + RIGHT$ (M$,A - 5): GOTO 31500
- 31400 IF A = 5 THEN M$ = LEFT$ (M$,3) + "0" + RIGHT$ (A$,1): GOTO 31500
- 31410 M$ = LEFT$ (M$,3) + "0" + RIGHT$ (A$,1) + RIGHT$ (M$,A - 5): GOTO 31500
- 31500 PRINT "ORDER=";M$;" TL=";TL
- 31510 IF M$ = "" THEN 31600
- 31520 GOTO 30100
- 31600 PRINT : PRINT : PRINT "TIME LEFT = "; INT (TL): PRINT " HIT 'RETURN' TO CONTINUE";: INPUT A$
- 31610 GOSUB 33000:DC$ = "": GOTO 20000
- 32000 K = VAL ( MID$ (M$,4,2))
- 32070 B$ = "00" + STR$ (K)
- 32080 UN$(U) = LEFT$ (UN$(U),1) + RIGHT$ (B$,2) + RIGHT$ (UN$(U),3):UN$ = UN$(U)
- 32100 I = LEN (M$): IF I < > 5 THEN M$ = RIGHT$ (M$,I - 5):MN$(U) = M$: GOTO 32110
- 32102 M$ = "":MN$(U) = ""
- 32110 RETURN
- 33000 I = 2: REM PLOT OLD DC'S **
- 33010 X0 = VAL ( MID$ (DC$,I,3)): IF X0 = 0 THEN RETURN
- 33020 Y0 = VAL ( MID$ (DC$,I + 3,3))
- 33030 GOSUB 30740
- 33040 I = I + 6: GOTO 33010
- 34000 D0 = VAL ( RIGHT$ (UN$,3)):D = VAL ( MID$ (M$,5,1)): REM MXXJN **
- 34012 IF MID$ (M$,4,1) = "P" THEN 34020
- 34014 D0 = D0 - D:A$ = "000" + STR$ (D0): GOTO 34030
- 34020 D0 = D0 + D:A$ = "000" + STR$ (D0)
- 34030 UN$ = LEFT$ (UN$,3) + RIGHT$ (A$,3)
- 34040 A = LEN (M$):M$ = RIGHT$ (M$,A - 5)
- 34050 UN$(U) = UN$: RETURN
- 35000 A = NE% - 1: REM FSG/FSS **
- 35010 FOR T = 0 TO A
- 35020 F$ = FS$(T):F = LEN (F$):B = 1: IF F = 0 THEN 35310
- 35030 Z = VAL ( MID$ (F$,B + 3,3)):D = VAL ( MID$ (F$,B + 6,4))
- 35040 X = UX(T) + D * COS ((450 - Z) * PI / 180):Y = UY(T) + D * SIN ((450 - Z) * PI / 180)
- 35060 X0 = X / AS:X0 = X0 + 136 - CX: IF X0 < 10 OR X0 > 250 THEN 35300
- 35080 Y0 = Y / AS:Y0 = 90 - Y0 + CY: IF Y0 < 10 OR Y0 > 170 THEN 35300
- 35100 IF MID$ (F$,B + 2,1) = "S" THEN 35250
- 35110 Y0 = Y0 - 3: HCOLOR= 5: FOR I = 0 TO 5: HPLOT X0 - 3,Y0 + I TO X0 + 3,Y0 + I: NEXT
- 35120 GOTO 35300
- 35250 HCOLOR= 1: HPLOT X0,Y0 - 5 TO X0 + 15,Y0 TO X0,Y0 + 5 TO X0 - 15,Y0 TO X0,Y0 - 5
- 35252 HPLOT X0 + 6,Y0 TO X0,Y0 - 20 TO X0 - 6,Y0 TO X0,Y0 + 20 TO X0 + 6,Y0
- 35254 HCOLOR= 3: HPLOT X0 - 10,Y0 - 10 TO X0 + 10,Y0 + 10: HPLOT X0 - 10,Y0 + 10 TO X0 + 10,Y0 - 10
- 35300 B = B + 10: IF B < F THEN 35030
- 35310 NEXT
- 35320 RETURN
- 40000 UN$ = UN$(U):U$ = U$(U): REM EXECUTE MDXTT **
- 40010 Z = VAL ( MID$ (UN$,4,3)):K0 = VAL ( MID$ (UN$,2,2))
- 40020 IF MID$ (NO$,3,1) < > "C" THEN 40100
- 40030 I = VAL ( MID$ (NO$,4,2)): IF I > 10 THEN STOP
- 40040 GOTO 40200
- 40100 IF MID$ (NO$,3,1) < > "P" AND MID$ (NO$,3,1) < > "S" THEN STOP
- 40110 GOSUB 29000:A = I
- 40120 J = A / 60:I = 10 / J
- 40130 Z = Z + 10: IF MID$ (NO$,3,1) = "P" THEN Z = Z - 20
- 40140 IF Z > 360 THEN Z = Z - 360
- 40150 IF Z < 0 THEN Z = Z + 360
- 40200 L0 = K0 * .5555 * I:Z2 = 450 - Z: IF Z2 > = 360 THEN Z2 = Z2 - 360
- 40210 X0 = XN(U) + L0 * COS (Z2 * PI / 180)
- 40220 Y0 = YN(U) + L0 * SIN (Z2 * PI / 180)
- 40230 GOSUB 8000
- 40300 XN(U) = X0:YN(U) = Y0
- 40310 A$ = "000" + STR$ (Z)
- 40330 UN$ = LEFT$ (UN$,3) + RIGHT$ (A$,3)
- 40340 UN$(U) = UN$: RETURN
- 52000 INVERSE : FLASH : PRINT : PRINT "ILLEGAL ENTRY"
- 52010 FOR I = 1 TO 1500: NEXT
- 52020 NORMAL : RETURN
- 60000 REM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- 60001 REM AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- REM PROG = P3
- 4 I = FRE (0)
- 30 & RECALL "MODULE.THREE.D"
- 40 CALL RESET%
- 60 CALL CRNCH%: CALL CRNCH%
- 69 PI = 355 / 113
- 100 GOSUB 53000: GOTO 10000
- 1000 TEXT : HOME : POKE 520,216: POKE 521,160: POKE 522,0: POKE 523,76: POKE 524,44: POKE 525,254
- 1010 IF NS% = 1 AND UX(US%) < > 69000 THEN AX = UX(US%):AY = UY(US%):U = US%: GOTO 1032
- 1020 GOSUB 11000: IF A$ = "Q" THEN RETURN
- 1030 AX = UX(U):AY = UY(U)
- 1032 P = VAL ( MID$ (U$(U),SM,3)): IF P < 31 THEN 1040
- 2573 GOTO 5040
- 1040 AS = 100:AC = 0
- 1090 CX = AX / AS:CY = AY / AS
- 1099 HGR
- 1100 CALL CLR%:UU = US% - 1
- 1101 X%(4) = 125:Y%(4) = 80:CODE%(4) = 1:SCALE%(4) = 9:XROT%(4) = 0: CALL CRNCH%: CALL CRNCH%
- 1102 IF FU$ < > "UR" THEN 1110
- 1104 S = 2:U = 0:SX(0) = UX(0):SY(0) = UY(0):UX(0) = FX%:UY(0) = FY%:Z = FZ%
- 1106 F2% = 1: GOSUB 1140:F2% = 0:UX(0) = SX(0):UY(0) = SY(0)
- 1110 FOR U = 0 TO UU
- 1120 U$ = U$(U)
- 1122 IF MID$ (U$,SQ,1) = "S" OR MID$ (U$,SQ,1) = "X" THEN 1132
- 1130 S = VAL ( LEFT$ (U$,1)): GOSUB 1140
- 1132 NEXT : GOTO 1260
- 1140 X = UX(U) / AS: IF CX > = 0 THEN X = X + 125 - CX: GOTO 1160
- 1150 X = X - CX + 125
- 1160 IF X < 15 OR X > 240 THEN 1250
- 1170 Y = UY(U) / AS: IF CY > = 0 THEN Y = 80 - Y + CY: GOTO 1190
- 1180 Y = 80 + CY - Y
- 1190 IF Y < 10 OR Y > 182 THEN 1250
- 1200 X%(S) = X:Y%(S) = Y:CODE%(S) = 1:SCALE%(S) = AC
- 1210 IF F2% = 0 THEN Z = VAL ( MID$ (U$,SN,3))
- 1220 ZROT%(S) = ABS ((Z / 13.3333) - 28)
- 1230 CALL CRNCH%: CALL CRNCH%
- 1240 X%(S) = 0:Y%(S) = 0:CODE%(S) = 0:ZROT%(S) = 0
- 1250 RETURN
- 1260 POKE - 16301,0
- 2000 Y0 = 0:X0 = 125
- 2100 D = 180
- 2110 J = D
- 2120 X = 76 * COS ((450 - J) * PI / 180)
- 2130 J = J + 180: IF J > 360 THEN J = J - 360
- 2140 Y = 76 * SIN ((450 - J) * PI / 180)
- 2150 X = X + 125
- 2160 Y = 80 - Y
- 2180 POKE - 16300,0
- 2200 HCOLOR= 3
- 2210 HPLOT 125,80 TO X,Y
- 2230 POKE 60,0: POKE 61,64: POKE 62,255: POKE 63,95: POKE 66,0: POKE 67,32: CALL 520
- 2270 K = PEEK ( - 16384)
- 2280 IF K > 127 THEN RETURN
- 2300 VTAB 21: HTAB 1
- 2340 PRINT "(R)ADAR (P)ERISCOPE (O)RDERS (TDC) (S)TATUS (E)ND TURN (GA)ME OVER";
- 2550 D = D - 10: IF D > = - 180 THEN 2110
- 3328
- GOTO 2100
- 5000 TEXT : HOME
- 5010 IF NS% = 1 AND UX(US%) < > 69000 THEN XC = UX(US%):YC = UY(US%): GOTO 5040
- 5020 GOSUB 11000: IF A$ = "Q" THEN RETURN
- 5030 XC = UX(U):YC = UY(U)
- 5040 P = VAL ( MID$ (U$(U),SM,3)): IF P < 31 THEN 5050
- 5042 PRINT "SUB TOO DEEP": PRINT "HIT 'RETURN' TO CONTINUE ";: INPUT A$: RETURN
- 5050 PRINT "ENTER DEGREE OF CENTRAL SCAN-";: INPUT A$:CD = VAL (A$):CC = 360 - CD: IF CD > - 1 AND CD < 361 THEN 5070
- 5060 PRINT : PRINT "ENTER DEGREE FROM 0 TO 359": PRINT : GOSUB 52000: GOTO 5050
- 5070 CALL CLR%
- 5080 X%(4) = 130:Y%(4) = 80:CODE%(4) = 1:SCALE%(4) = 15:XROT%(4) = 4
- 5082 X%(5) = 130:Y%(5) = 78:CODE%(5) = 1:SCALE%(5) = 15:XROT%(5) = 4
- 5083 GOSUB 7000
- 5084 CALL CRNCH%: CALL CRNCH%
- 5086 CODE%(4) = 0:CODE%(5) = 0
- 5090 HCOLOR= 0: HPLOT 130,22 TO 130,180: HPLOT 2,79 TO 260,79: HPLOT 2,80 TO 260,80
- 5092 UU = US% - 1
- 5100 FOR U = 0 TO UU
- 5104 U$ = U$(U):A$ = MID$ (U$,SQ,1): IF A$ = "X" OR A$ = "R" OR A$ = "S" THEN 5122
- 5110 S = VAL ( LEFT$ (U$,1)): IF S > 2 THEN 5122
- 5120 F0 = 0: GOSUB 5140
- 5122 NEXT
- 5124 GOTO 5600
- 5140 J = 360 - CD: IF J < 000 THEN J = J + 360
- 5142 K = J + 90: IF K > 360 THEN K = K - 360
- 5144 IF J = 180 OR J = 360 THEN J = 0
- 5146 IF K = 360 OR K = 180 THEN K = 0
- 5150 X1 = UY(U) * SIN ((J) * PI / 180) + UX(U) * SIN ((K) * PI / 180)
- 5160 CX = YC * SIN ((J) * PI / 180) + XC * SIN ((K) * PI / 180)
- 5170 J = J + 180: IF J > 360 THEN J = J - 360
- 5172 IF J = 180 OR J = 360 THEN J = 0
- 5180 Y1 = UX(U) * SIN ((J) * PI / 180) + UY(U) * SIN ((K) * PI / 180)
- 5190 CY = XC * SIN ((J) * PI / 180) + YC * SIN ((K) * PI / 180)
- 5192 X1 = INT (X1):CX = INT (CX):Y1 = INT (Y1):CY = INT (CY)
- 5200 CY = CY:A = (X1 - CX) * (X1 - CX):B = (Y1 - CY) * (Y1 - CY)
- 5210 D = SQR (A + B): IF D = 0 THEN F2% = 1: GOTO 5550
- 5220 D = INT (D / 10):D = D * 10
- 28266 IF Y1 - CY < = 0 THEN F2% = 1: GOTO 5550
- 5240 IF X1 - CX < = 0 THEN 5280
- 5250 D0 = (X1 - CX) / (Y1 - CY): IF D0 < = 1 THEN 5280
- 5260 IF D0 > = - 1 THEN 5280
- 5270 F2% = 1: GOTO 5550
- 5280 Y = 200
- 5290 IF D < 10 THEN F2% = 1: GOTO 5550
- 5300 D1 = D:D = ABS (CY) + Y1: IF CY > 0 AND Y1 > 0 THEN D = Y1 - CY
- 5310 IF D > 3400 THEN Y = 22:X2 = 30: GOTO 5420
- 5320 K = D / 500: IF K < 1 THEN 5350
- 5330 ON K GOTO 5360,5370,5380,5390,5400,5410
- 5340 STOP : REM REMOVE
- 5350 Y = 160 - (D * .088):X2 = 5: GOTO 5420
- 5360 J = D - 500:Y = 116 - (J * .064):X2 = 7.5: GOTO 5420
- 5370 J = D - 1000:Y = 84 - (J * .05):K = J * .007:X2 = 9.5 + K: GOTO 5420
- 5380 J = D - 1500:Y = 59 - (J * .036):K = J * .008:X2 = 13 + K: GOTO 5420
- 5390 J = D - 2000:Y = 41 - (J * .026):K = J * .012:X2 = 17 + K: GOTO 5420
- 5400 J = D - 2500:Y = 28 - (J * .012):K = J * .004:X2 = 23 + K: GOTO 5420
- 5410 J = D - 3000:Y = 22 - (J * .002):X2 = 25
- 5420 IF Y < 22 THEN Y = 22
- 5422 IF Y > 170 THEN F2% = 1: GOTO 5540
- 5430 X = 130 + (X1 / X2) - (CX / X2):D = D1
- 5432 IF X < 10 OR X > 245 THEN F2% = 1: GOTO 5540
- 5434 IF Y = 22 AND (X < 50 OR X > 200) THEN 5540
- 5436 IF Y < 30 AND (X < 30 OR X > 220) THEN 5540
- 5438 IF Y < 45 AND (X < 30 OR X > 220) THEN 5540
- 5450 IF Y < 10 OR Y > 182 THEN 5540
- 5460 Z = VAL ( MID$ (U$,SN,3))
- 5470 Z = Z - CD: IF Z > 360 THEN Z = Z - 360
- 5480 IF Z > 360 THEN Z = Z - 360
- 5490 IF Z < 0 THEN Z = Z + 360
- 5492 IF F0 = 1 THEN RETURN
- 5500 ZROT%(S) = ABS ((Z / 13.3333) - 28)
- 5510 SCALE%(S) = (1000 / D) * 4 + 1
- 5520 X%(S) = X:Y%(S) = Y:CODE%(S) = 1:XROT%(S) = 7
- 5522 CALL CRNCH%: CALL CRNCH%
- 5524 X%(S) = X + 1: CALL CRNCH%: CALL CRNCH%
- 5530 CALL CRNCH%: CALL CRNCH%
- 5540 X%(S) = 0:Y%(S) = 0:CODE%(S) = 0:SCALE%(S) = 0:XROT%(S) = 0:ZROT%(S) = 0
- 5550 RETURN
- 5600 GOSUB 8000: POKE - 16301,0
- 5610 HOME : VTAB 23
- 5620 PRINT "X="; INT (XC);" Y="; INT (YC);" DIR=";CD
- 5630 PRINT : PRINT "HIT 'RETURN' TO CONTINUE";: INPUT A$: RETURN
- 7000 HCOLOR= 2: HGR :J = 83:X = 130
- 7002 CALL CRNCH%: CALL CRNCH%
- 7010 FOR I = 22 TO 40
- 7020 HPLOT X - J,I TO X + J + 2,I
- 7030 J = J + 1.34
- 7040 NEXT
- 7050 FOR I = 41 TO 65
- 7060 HPLOT X - J,I TO X + J,I
- 7070 J = J + .67
- 7080 NEXT
- 7090 FOR I = 66 TO 80
- 7100 HPLOT X - J,I TO X + J,I
- 7110 J = J + .25
- 7120 NEXT
- 7130 FOR I = 81 TO 95
- 7140 HPLOT X - J,I TO X + J,I
- 7150 J = J - .25
- 7160 NEXT
- 7180 FOR I = 96 TO 110: HPLOT X - J,I TO X + J,I:J = J - .67: NEXT
- 7190 FOR I = 111 TO 125: HPLOT X - J,I TO X + J,I:J = J - 1: NEXT
- 7200 FOR I = 126 TO 145: HPLOT X - J,I TO X + J,I:J = J - 1.5: NEXT
- 7210 FOR I = 146 TO 160: HPLOT X - J,I TO X + J,I:J = J - 3.5: NEXT
- 7220 POKE 512,216: POKE 513,160: POKE 514,0: POKE 515,76: POKE 516,44: POKE 517,254: POKE 60,0: POKE 61,32: POKE 62,255: POKE 63,63: POKE 66,0: POKE 67,64: CALL 512
- 7230 POKE - 16302,0
- 7299 RETURN
- 8000 IF TI% = 0 THEN RETURN
- 8010 UU = TI% - 1:SX(0) = UX(0):SY(0) = UY(0):U = 0:F0 = 1
- 8100 FOR AB = 0 TO UU
- 8110 UX(0) = TX(AB):UY(0) = TY(AB):F2% = 0: GOSUB 5140: IF F2% = 1 THEN 8130
- 8120 HCOLOR= 5: FOR I = 0 TO 5: HPLOT X - 2,Y + I TO X + 2,Y + I: NEXT
- 8122 HPLOT X - 4,Y - 0 TO X + 4,Y - 0
- 8130 NEXT
- 8140 UX(0) = SX(0):UY(0) = SY(0):F2% = 0:F0 = 0: RETURN
- 10000 HOME : PRINT : VTAB 24
- 10020 I = FRE (0)
- 10100 PRINT "(R)ADAR (P)ERISCOPE (O)RDERS (TDC) (S)TATUS (E)ND TURN (GA)ME OVER";
- 10110 INPUT A$
- 10120 IF A$ = "E" THEN GOTO 19000
- 10130 IF A$ = "O" THEN GOSUB 20000: GOTO 10000
- 10140 IF A$ = "R" THEN GOSUB 1000: GOTO 10000
- 10150 IF A$ = "P" THEN GOSUB 5000: GOTO 10000
- 10160 IF A$ = "TDC" THEN GOSUB 30000: GOTO 10000
- 10170 IF A$ = "S" THEN GOSUB 12000: VTAB 22: GOTO 10100
- 10180 IF A$ = "GA" THEN 19500
- 10200 PRINT : PRINT : PRINT "ONLY 'R P O TDC S E GA' ARE LEGAL"
- 10210 GOSUB 52000: GOTO 10000
- 11000 PRINT "ENTER ID OF SUB AT CENTER ";
- 11010 INPUT A$: IF A$ = "Q" THEN RETURN
- 11020 U = US%
- 11030 IF A$ < > MID$ (U$(U),SB,2) THEN 11040
- 11032 IF UX(U) = 69000 THEN A$ = "Q": RETURN
- 11034 U$ = U$(U): RETURN
- 11040 U = U + 1: IF U < = UT THEN 11030
- 11050 PRINT : PRINT "NO SUCH SHIP": GOSUB 52000: GOTO 11000
- 12000 IF US% = UT THEN U = UT:O = NE%: GOTO 12090
- 12010 PRINT "ENTER ID FOR STATUS ";: INPUT A$: IF A$ = "Q" THEN RETURN
- 12020 U = US%:O = NE%
- 12030 IF A$ = MID$ (U$(U),SB,2) THEN 12090
- 12040 O = O + 1:U = U + 1: IF U < = UT THEN 12030
- 12050 PRINT "NO SUCH SHIP": GOSUB 52000: GOTO 12000
- 12090 U$ = U$(U): TEXT
- 12100 TEXT : HOME : HTAB 15: INVERSE : PRINT " STATUS REPORT ": NORMAL
- 12110 VTAB 3: HTAB 1: PRINT "SHIP MAP POSITION"
- 12120 VTAB 4: PRINT " ID";: HTAB 6: PRINT "X";: HTAB 13: PRINT "Y";: HTAB 20: PRINT "SPEED DIR DEPTH TURN"
- 12130 VTAB 5: HTAB 2: PRINT MID$ (U$,SB,2);: HTAB 6: PRINT INT (UX(U));: HTAB 13: PRINT INT (UY(U));
- 12132 HTAB 21: PRINT MID$ (U$,SI,2);: IF MID$ (U$,SM,3) < > "000" THEN VTAB 5: HTAB 21: PRINT MID$ (U$,SK,2);
- 12134 HTAB 26: PRINT MID$ (U$,SN,3);: HTAB 31: PRINT MID$ (U$,SM,3);: HTAB 38: PRINT QP%
- 12140 VTAB 7: PRINT " DP'S VP'S";: HTAB 24: PRINT "TORPEDO STATUS"
- 12150 VTAB 8: PRINT "BEG NOW ESC SUB ...BOW... ..STERN.."
- 12160 VTAB 9: PRINT MID$ (U$,SU,2);: HTAB 6: PRINT MID$ (U$,SV,2);" ";VS%;" ";VU%;
- 12170 HTAB 22: PRINT MID$ (TB$(U - US%),2,9);: HTAB 32: PRINT MID$ (TS$(U - US%),2,9)
- 12180 PRINT " SHIP DISTURBED"
- 12182 PRINT "CLASS WATER"
- 12184 HTAB 2: PRINT MID$ (U$,SE,2);: HTAB 10: IF MID$ (U$,SB%,1) = "Y" THEN INVERSE : PRINT "YES": NORMAL : GOTO 12200
- 12186 PRINT "NO"
- 43127 / VTAB 15: INVERSE : PRINT "SONAR REPORTS OF ENEMY SHIPS": NORMAL
- 12210 UU = US% - 1:X0 = UX(U):Y0 = UY(U):J = 0
- 12220 FOR I = 0 TO UU
- 12222 IF UX(U) = 69000 THEN 12250
- 12230 IF MID$ (U$(I),SQ,1) < > "S" THEN 12250
- 12240 X2 = UX(I):Y2 = UY(I): GOSUB 30900: PRINT " "; INT (A);:J = 1
- 12250 NEXT
- 12260 IF FU$ < > "US" THEN 12280
- 12270 X2 = FX%:Y2 = FY%: GOSUB 30900: PRINT " "; INT (A);:J = 1
- 12280 IF J = 0 THEN PRINT "NONE";
- 12290 PRINT : PRINT
- 12400 GOSUB 23120
- 12410 PRINT : PRINT "ENTER 'T' FOR TORPEDO STATUS";: INPUT A$: IF A$ < > "T" THEN 12500
- 12420 HOME : HTAB 10: INVERSE : PRINT " LIVE TORPEDOES AT ": NORMAL : PRINT
- 12430 PRINT " X Y DIR TURNS LEFT": PRINT
- 12440 A = TI% - 1: IF TI% = 0 THEN 12500
- 12450 FOR I = 0 TO A: HTAB 2: PRINT INT (TX(I));: HTAB 10: PRINT INT (TY(I));: HTAB 19: PRINT TZ%(I);
- 12460 HTAB 28: PRINT MID$ (TA$,I + 2,1)
- 12470 NEXT
- 12500 RETURN
- 19000 TEXT : HOME :I = FRE (0)
- 19100 VTAB 12: HTAB 10: INVERSE : PRINT " LOADING ORDERS PHASE ": HTAB 14: PRINT " SURFACE SIDE ": NORMAL
- 19200 & GOTO "P2"
- 19500 TEXT : HOME
- 19510 VTAB 12: HTAB 10: INVERSE : PRINT " LOADING FINAL PHASE ": NORMAL
- 19520 & GOTO "PGA"
- 20000 HOME : VTAB 24: IF US% = (UT) AND UX(US%) < > 69000 THEN U = US%:O = NE%: GOTO 20200
- 20010 HOME : VTAB 24: PRINT "ENTER ID OF SHIP TO BE GIVEN ORDERS ": PRINT "('Q' = QUIT) ";
- 20020 INPUT A$: IF A$ = "Q" THEN RETURN
- 20030 U = US%:O = NE%
- 20040 IF MID$ (U$(U),SB,2) = A$ AND UX(U) < > 69000 THEN U$ = U$(U): GOTO 20200
- 20050 O = O + 1:U = U + 1: IF U < = UT THEN 20040
- 20060 PRINT "YOU CAN'T ORDER THAT SHIP!": GOSUB 52000: GOTO 20000
- 20200 U$ = U$(U): PRINT : PRINT : PRINT "DO YOU WISH TO ENTER (M)OVE OR (F)IRE ORDERS OR (Q)UIT ";
- 20210 INPUT A$: IF A$ = "Q" THEN RETURN
- 20220 IF A$ = "M" THEN 20300
- 20230 IF A$ = "F" THEN 22000
- 20250 PRINT : PRINT "ONLY 'M F Q' ALLOWED": GOSUB 52000: GOTO 20200
- 20300 GOSUB 23100
- 20310 PRINT "(N)EW, (A)DD OR (Q)UIT ";: INPUT A$: IF A$ = "Q" THEN 20200
- 20320 IF A$ = "N" THEN MO$(O) = "": GOTO 20400
- 20330 IF A$ = "A" THEN 20400
- 20340 PRINT "ONLY 'N A Q' ALLOWED": GOSUB 52000: GOTO 20300
- 20400 GOSUB 23100
- 20410 PRINT "ENTER MOVEMENT ORDER (SEC. 4.1) ";:
- 20420 INPUT A$: IF A$ = "Q" THEN 20200
- 20430 I = LEN (A$): IF I < > 5 THEN 20470
- 20440 IF LEFT$ (A$,3) = "MSS" THEN 20500
- 20450 IF LEFT$ (A$,2) = "MD" THEN 21000
- 20460 IF LEFT$ (A$,2) = "MU" THEN 21500
- 20462 IF LEFT$ (A$,2) = "MC" THEN 21300
- 20470 PRINT "BAD FORMAT": GOSUB 52000: GOTO 20400
- 20500 A = LEN (MO$(O)):B = 1:X = 0
- 20502 IF MID$ (MO$(O),B,3) = "MSS" THEN X = 1
- 20504 B = B + 5: IF B < = (A) THEN 20502
- 20506 IF X = 1 THEN PRINT : PRINT "ONLY 1 SPEED CHANGE PER TURN": GOSUB 52000: GOTO 20400
- 20507 I = VAL ( RIGHT$ (A$,2)): IF I < 0 THEN PRINT : PRINT "CAN'T GO BACKWARDS": GOSUB 52000: GOTO 20400
- 20508 D = VAL ( MID$ (U$,SM,3)): IF D < > 0 THEN 20600
- 20510 I = VAL ( RIGHT$ (A$,2)):J = VAL ( MID$ (U$,SH,2)):K = J / 3
- 20520 IF I < = J THEN 20540
- 20530 PRINT : PRINT "CAN'T EXCEED MAX SPEED": GOSUB 52000: GOTO 20400
- 20540 J = VAL ( MID$ (U$,SI,2)): IF ABS (J - I) < = K THEN 20560
- 20550 PRINT : PRINT "CAN'T CHANGE SPEED THAT MUCH": GOSUB 52000: GOTO 20400
- 20560 MO$(O) = MO$(O) + A$: GOTO 20300
- 20600 I = VAL ( RIGHT$ (A$,2)):J = VAL ( MID$ (U$,SJ,2)):K = J / 3
- 20620 IF I < = J THEN 20640
- 20630 GOTO 20530
- 20640 J = VAL ( MID$ (U$,SK,2)): IF ABS (J - I) < = K THEN 20560
- 20650 GOTO 20550
- 21000 IF MID$ (A$,3,1) = "C" THEN 21030
- 21010 IF MID$ (A$,3,1) = "P" OR MID$ (A$,3,1) = "S" THEN 21050
- 21020 GOTO 20470
- 21030 I = VAL ( MID$ (A$,4,2)): IF I > 9 AND I < 61 THEN 20560
- 21040 PRINT "YOU MUST ENTER 10-60 TIME POINTS": GOSUB 52000: GOTO 20400
- 21050 I = VAL ( MID$ (A$,4,2)): IF I > 0 AND I < 19 THEN 20560
- 21060 PRINT "TURN MUST BE 01-18": GOSUB 52000: GOTO 20400
- 21300 A = VAL ( RIGHT$ (A$,3)): IF A > = 0 AND A < 360 THEN 20560
- 21310 PRINT "COURSE MUST BE 000 TO 359": GOSUB 52000: GOTO 20400
- 21500 D = VAL ( RIGHT$ (A$,3)):D0 = VAL ( MID$ (U$,SM,3)): IF D0 < D THEN 21530
- 21510 K = VAL ( MID$ (U$,SP,3)): IF D0 - D < = K THEN 21550
- 21520 PRINT "CAN'T RISE THAT FAST": GOSUB 52000: GOTO 20400
- 21530 K = VAL ( MID$ (U$,SO,3)): IF D - D0 < = K THEN 21550
- 21540 PRINT "CAN'T DIVE THAT FAST": GOSUB 52000: GOTO 20400
- 21550 I = VAL ( MID$ (U$,SL,3)): IF D < = I THEN 20560
- 21560 FLASH : PRINT : PRINT "WARNING! MAX DEPTH EXCEEDED": NORMAL
- 21570 FOR I = 0 TO 3000: NEXT : GOTO 20560
- 22000 GOSUB 23100
- 22010 PRINT "(N)EW, (A)DD OR (Q)UIT";
- 22020 INPUT A$: IF A$ = "Q" THEN 20200
- 22030 IF A$ = "N" THEN FO$(O) = "":FS$(O) = "": GOTO 22100
- 22040 IF A$ = "A" THEN 22100
- 22050 PRINT "ONLY 'N A Q' ALLOWED": GOSUB 52000: GOTO 22000
- 22100 GOSUB 23100
- 22110 PRINT "ENTER FIRE ORDER (SEC. 4.2) ";
- 22120 INPUT A$: IF A$ = "Q" THEN 20200
- 22122 IF LEFT$ (A$,3) = "FSG" THEN 22600
- 22130 A = LEN (A$): IF A < > 8 THEN 22134
- 22132 GOTO 22140
- 22134 PRINT "BAD FORMAT": GOSUB 52000: GOTO 22100
- 22140 IF MID$ (A$,3,1) = "B" OR MID$ (A$,3,1) = "S" THEN 22160
- 22150 GOTO 22134
- 22160 D = VAL ( MID$ (A$,4,3)): IF D > - 1 AND D < 361 THEN 22180
- 22170 PRINT "YOU CAN FIRE 0-360 DEGREES ONLY": GOSUB 52000: GOTO 22100
- 22180 A = VAL ( MID$ (A$,7,2)): IF A > - 1 AND A < 51 THEN 22200
- 22190 PRINT "TIME POINTS MUST BE 00-50": GOSUB 52000: GOTO 22100
- 22200 A = U - US%:F$ = FO$(O) + A$:B = 1:C = LEN (F$):X = 0:X0 = 0:Y = 0:Y0 = 0
- 22210 IF MID$ (F$,B + 2,1) = "B" THEN X = X + 1
- 22220 IF MID$ (F$,B + 2,1) = "S" THEN Y = Y + 1
- 22230 B = B + 8: IF B < C THEN 22210
- 22250 FOR I = 2 TO 10
- 22260 IF MID$ (TB$(A),I,1) = "L" THEN X0 = X0 + 1
- 22270 IF MID$ (TS$(A),I,1) = "L" THEN Y0 = Y0 + 1
- 22280 NEXT
- 22290 IF X < = X0 THEN 22310
- 22300 PRINT "NOT ENOUGH 'L'OADED TUBES": GOSUB 52000: GOTO 22100
- 22310 IF Y < = Y0 THEN 22330
- 22320 GOTO 22300
- 22330 D0 = VAL ( MID$ (U$,SN,3)): IF MID$ (A$,3,1) = "S" THEN D0 = D0 + 180
- 22340 IF D0 > 360 THEN D0 = D0 - 360
- 22350 I = ABS (D - D0): IF I > 180 THEN I = 360 - I
- 22360 IF I < = 120 THEN 22380
- 22370 FLASH : PRINT "WARNING !": NORMAL : PRINT "IF ANGLE NOT +/- 120 DEGREES THEN": PRINT "TORPEDO WILL SINK (SEC. 4.22)": PRINT "HIT' RETURN ' TO CONTINUE ";: INPUT B$
- 22380 FO$(O) = FO$(O) + A$: GOTO 22000
- 22600 A = LEN (A$): IF A < > 10 THEN 22134
- 22610 I = VAL ( MID$ (A$,4,3)): IF I > = 0 AND I < 360 THEN 22630
- 22620 PRINT "ANGLE MUST BE 000-359 DEGREES": GOSUB 52000: GOTO 22100
- 22630 J = VAL ( RIGHT$ (A$,4)): IF J > 0 THEN 22650
- 22640 PRINT "DISTANCE MUST BE POSITIVE": GOSUB 52000: GOTO 22100
- 22650 IF FS$(O) < > "" THEN PRINT "ONLY ONE 'FSG' ALLOWED": GOSUB 52000: GOTO 22100
- 22660 I = VAL ( MID$ (U$,SW,2)): IF I < 1 THEN PRINT "SUB HAS NO GUNS": GOSUB 52000: GOTO 22100
- 22700 FS$(O) = A$: GOTO 22000
- 23100 PRINT : PRINT
- 23110 PRINT MID$ (U$,SB,2);" X="; INT (UX(U));" Y="; INT (UY(U));
- 23112 IF MID$ (U$,SM,3) < > "000" THEN PRINT " KU="; MID$ (U$,SK,2);" D="; MID$ (U$,SM,3);
- 23114 IF MID$ (U$,SM,3) = "000" THEN PRINT " KS="; MID$ (U$,SI,2);
- 23116 PRINT " DIR="; MID$ (U$,SN,3)
- 23120 PRINT "MOVE ORDERS = ";MO$(O): PRINT "FIRE ORDERS = ";FO$(O);FS$(O)
- 23130 RETURN
- 30000 TEXT : HOME : HTAB 10: INVERSE : PRINT "TARGET DATA COMPUTER": NORMAL
- 30001 PI = 3.14159
- 30010 VTAB 4: PRINT "PLEASE ENTER THE FOLLOWING DATA"
- 30012 PRINT : PRINT "SUB'S X = ";: INPUT A$:X0 = VAL (A$): IF A$ = "Q" THEN RETURN
- 30020 PRINT "SUBS'S Y = ";: INPUT A$:Y0 = VAL (A$)
- 30030 PRINT "SUB'S DIRECTION = ";: INPUT A$:Z0 = VAL (A$): IF Z0 > = 0 AND Z0 < 360 THEN 30050
- 30040 PRINT "0-359 DEGREES ONLY": GOSUB 52000: GOTO 30030
- 30050 PRINT "SUB'S SPEED = ";: INPUT A$:K0 = VAL (A$)
- 30060 PRINT "(B)OW OR (S)TERN TUBE ";: INPUT B$: IF B$ = "B" OR B$ = "S" THEN 30080
- 30070 PRINT "ONLY 'B S' ALLOWED": GOSUB 52000: GOTO 30060
- 30080 PRINT : PRINT "TARGET'S X = ";: INPUT A$:XT = VAL (A$): IF A$ = "Q" THEN 30000
- 30090 PRINT "TARGET'S Y = ";: INPUT A$:YT = VAL (A$)
- 30100 PRINT "TARGET'S DIRECTION = ";: INPUT A$:Z1 = VAL (A$): IF Z1 > = 0 AND Z1 < 360 THEN 30120
- 30110 PRINT "0-359 DEGREES ONLY": GOSUB 52000: GOTO 30100
- 30120 PRINT "TARGET'S SPEED = ";: INPUT A$:K1 = VAL (A$): IF A$ = "Q" THEN 30000
- 30150 IF B$ = "S" THEN Z0 = Z0 + 180: IF Z0 > = 360 THEN Z0 = Z0 - 360
- 30152 I = 450 - Z0
- 30160 X2 = X0 + (100 + 10 * K0 * .5555) * COS (I * PI / 180):X0 = X2
- 30170 Y2 = Y0 + (100 + 10 * K0 * .5555) * SIN (I * PI / 180):Y0 = Y2
- 30200 X1 = XT:Y1 = YT:T = 0:L1 = 3 * K1 * .5555:L0 = 30 * .5555:Z2 = 450 - Z1
- 30210 VTAB 17: HTAB 1: PRINT "WORKING ";: INVERSE : PRINT " *";:I = I + 1: IF I > 1 THEN I = 0: GOTO 30230
- 30220 HTAB 9: PRINT "* ";
- 30230 NORMAL
- 30240 X2 = X1 + L1 * COS (Z2 * PI / 180):Y2 = Y1 + L1 * SIN (Z2 * PI / 180):T = T + 3
- 30250 D = SQR ((X0 - X2) ^ 2 + (Y0 - Y2) ^ 2):X1 = X2:Y1 = Y2
- 30260 T0 = D / L0: IF T0 > (T) AND D < 10000 THEN 30210
- 30270 GOSUB 30900
- 30280 Z2 = ABS (A - Z1): IF Z2 > 180 THEN Z2 = Z2 - 180
- 30300 PRINT : PRINT : PRINT "ANGLE TO FIRE TORPEDO = "; INT (A)
- 30310 PRINT "PROJECTED HIT ANGLE (SEC. 6.8) = "; INT (Z2)
- 30320 PRINT "PROJECTED TIME TILL DETONATION = "; INT (T0)
- 30400 PRINT : PRINT "HIT 'RETURN' TO CONTINUE ";: INPUT A$: RETURN
- 30900 IF Y0 = Y2 THEN Y0 = Y0 + 1
- 30902 AA = ATN ((X0 - X2) / (Y0 - Y2)) * 180 / PI
- 30904 X = INT (X2 - X0 + .5):Y = INT (Y2 - Y0 + .5)
- 30910 IF AA > 0 THEN 30940
- 30920 IF X > 0 THEN A = 180 + AA: GOTO 30960
- 30922 A = 360 + AA: GOTO 30960
- 30940 IF X > = 0 AND Y > = 0 THEN A = AA: GOTO 30960
- 30942 IF X < = 0 AND Y < = 0 THEN A = AA: GOTO 30960
- 30950 A = 180 + AA
- 30960 RETURN
- 52000 INVERSE : FLASH : PRINT : PRINT "ILLEGAL ENTRY"
- 52010 FOR I = 0 TO 1500: NEXT : NORMAL : RETURN
- 53000 CALL CLR%: HGR : HCOLOR= 2: HPLOT 0,0 TO 0,0: CALL 62454
- 53010 FOR I = 0 TO 2:CODE%(I) = 1:SCALE%(I) = 8:XROT%(I) = 7: NEXT
- 53020 X%(0) = 90:Y%(0) = 40
- 53030 X%(1) = 180:Y%(1) = 40
- 53040 X%(2) = 135:Y%(2) = 110
- 53050 J = 7: IF RND (1) > .5 THEN J = 21
- 53060 FOR I = 0 TO 2:ZROT%(I) = J: NEXT
- 53100 CALL CRNCH%: CALL CRNCH%
- 53102 FOR I = 0 TO 2:X%(I) = X%(I) + 1: NEXT : CALL CRNCH%: CALL CRNCH%
- 53110 POKE - 16301,0
- 53112 FOR I = 0 TO 2:CODE%(I) = 0:XROT%(I) = 0: NEXT
- 53120 VTAB 23: HTAB 1: PRINT "ENTER PASSWORD ";: INPUT A$: IF A$ = PU$ THEN RETURN
- 53130 GOSUB 52000: PRINT : PRINT : PRINT : GOTO 53000
- 63000 REM PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
- 63001 REM PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
- 63002 REM PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
- 63003 REM PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
- 63004 REM PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
- REM PROG = P4
- 4 I = FRE (0): HOME : GOSUB 57000
- 2573
- 21968 S%
- 20 FOR U = 0 TO UT:U$(U) = LEFT$ (U$(U),SB% - 1) + "N" + RIGHT$ (U$(U),S9 - SB%): NEXT
- 100 GOTO 10000
- 1000 UN$ = UN$(U):U$ = U$(U)
- 1010 Z = VAL ( MID$ (UN$,4,3)):K0 = VAL ( MID$ (UN$,2,2))
- 1020 IF MID$ (NO$,3,1) < > "C" THEN 1100
- 1030 T = VAL ( MID$ (NO$,4,2)): IF T > 10 THEN STOP
- 1040 GOTO 1200
- 1100 IF MID$ (NO$,3,1) < > "P" AND MID$ (NO$,3,1) < > "S" THEN STOP
- 1110 GOSUB 29000:A = I
- 1120 J = A / 60:T = 10 / J
- 1130 Z = Z + 10: IF MID$ (NO$,3,1) = "P" THEN Z = Z - 20
- 1140 IF Z > 360 THEN Z = Z - 360
- 1150 IF Z < 0 THEN Z = Z + 360
- 1200 L0 = K0 * .5555 * T:Z2 = 450 - Z: IF Z2 > = 360 THEN Z2 = Z2 - 360
- 1210 X0 = XN(U) + L0 * COS (Z2 * PI / 180)
- 1220 Y0 = YN(U) + L0 * SIN (Z2 * PI / 180)
- 1300 XN(U) = X0:YN(U) = Y0
- 7778 A$ = "000" + STR$ (Z)
- 1330 UN$ = LEFT$ (UN$,3) + RIGHT$ (A$,3)
- 1340 UN$(U) = UN$: RETURN
- 10000 IF MO$(CO%) = "" THEN MO$(CO%) = "MDC60"
- 10002 IF LEFT$ (MO$(CO%),3) < > "MDC" THEN CT% = QP% + 5:MO$(CO%) = MO$(CO%) + "MDC60"
- 10004 IF LEFT$ (MO$(CO%),3) = "MDC" THEN MO$(CO%) = "MDC60MDC60"
- 10010 FOR U = 0 TO UT
- 10012 U$ = U$(U):UN$(U) = LEFT$ (U$,1) + MID$ (U$,SI,2) + MID$ (U$,SN,3):XN(U) = UX(U):YN(U) = UY(U)
- 10013 IF U < US% THEN 10016
- 10014 IF MID$ (U$,SM,3) < > "000" THEN UN$(U) = LEFT$ (U$,1) + MID$ (U$,SK,2) + MID$ (U$,SN,3)
- 10016 NEXT
- 10020 J = CO% - 1
- 10030 FOR I = 0 TO J:MO$(I) = MO$(I) + "MDC60MDC60":TU%(I) = 0: NEXT
- 10032 TU%(CO%) = 0
- 10040 GOSUB 36500: GOSUB 36000: GOSUB 24000
- 10100 TU% = 3:TT% = 2
- 10110 GOSUB 11000
- 32868 ' GOSUB 11800: REM MOVE TORPEDOES
- 10120 GOSUB 12000
- 10130 GOSUB 15000
- 10132 GOSUB 16000: REM TORPEDO FIRE CHAEK
- 10140 GOSUB 20000: REM DEPTH CHARGE COMBAT
- 10150 GOSUB 21000: REM TORPEDO COMBAT
- 10200 TU% = TU% + 3: IF TU% < 61 THEN 10110
- 10202 HGR : POKE - 16302,0
- 10204 FOR I = 5 TO 7
- 10205 HCOLOR= I: HPLOT 0,0 TO 0,0: CALL 62454
- 10206 FOR J = 0 TO 100:X = PEEK ( - 16336): NEXT
- 10207 NEXT : TEXT
- 10220 PRINT : PRINT : PRINT "HIT 'RETURN' FOR SEARCH PHASE ";: INPUT A$
- 10999 GOTO 19000
- 11000 O = 0
- 11100 T = 0: IF TU%(O) < TU% THEN 11130
- 11110 O = O + 1: IF O > CO% THEN RETURN
- 11120 GOTO 11100
- 11130 IF O = CO% THEN 11200
- 11140 IF O < NE% THEN U = O: GOTO 11160
- 11150 I = O - NE%:U = US% + I
- 11160 U$ = U$(U):UN$ = UN$(U)
- 11170 IF XN(U) = 69000 THEN 11110
- 11180 GOSUB 11300
- 11199 TU%(O) = TU%(O) + T: GOTO 11100
- 11200 IF MID$ (MO$(O),3,1) = "C" THEN NO$ = "MDC10": GOTO 11220
- 11202 IF LEFT$ (MO$(O),2) = "MX" THEN GOSUB 35000: GOTO 11200
- 11210 NO$ = LEFT$ (MO$(O),3) + "01"
- 11220 UU = UT% + NT% + NF% - 1:CC = UT%
- 11230 FOR U = CC TO UU
- 11240 IF XN(U) = 69000 THEN 11250
- 11242 IF MID$ (UN$(U),2,2) < > "00" THEN UN$ = UN$(U): GOSUB 1000
- 11250 NEXT
- 11252 IF T = 0 THEN T = 2
- 11260 IF LEFT$ (MO$(O),3) = "MDC" THEN 11290
- 11270 M$ = MO$(O):J = LEN (M$):I = VAL ( MID$ (M$,4,2)):I = I - 1: IF I = 0 THEN M$ = RIGHT$ (M$,J - 5): GOTO 11288
- 11272 A$ = "00" + STR$ (I):M$ = LEFT$ (M$,3) + RIGHT$ (A$,2) + RIGHT$ (M$,J - 5)
- 11288 MO$(O) = M$: IF LEFT$ (M$,2) = "MX" THEN 11202
- 11290 GOTO 11199
- 11300 M$ = MO$(O)
- 11310 IF LEFT$ (M$,3) = "MSS" THEN GOSUB 14000: GOTO 11300
- 11312 IF LEFT$ (M$,3) = "MXX" THEN GOSUB 34000: GOTO 11300
- 11314 IF LEFT$ (M$,2) = "MC" THEN GOSUB 28000: GOTO 11300
- 11320 IF LEFT$ (M$,2) = "MU" THEN GOSUB 14200: GOTO 11300
- 11330 IF LEFT$ (M$,3) < > "MDC" THEN 11500
- 11340 TL = VAL ( MID$ (M$,4,2))
- 11350 IF TL = 1 THEN NO$ = "MDC01": GOTO 11370
- 11360 NO$ = "MDC02"
- 11370 GOSUB 1000
- 11380 I = VAL ( MID$ (NO$,4,2)):TL = TL - I
- 11390 J = LEN (M$): IF TL = 0 THEN M$ = RIGHT$ (M$,J - 5): GOTO 11420
- 11400 A$ = STR$ (TL): IF TL < 10 THEN A$ = "0" + A$
- 11410 M$ = "MDC" + A$ + RIGHT$ (M$,J - 5)
- 11420 MO$(O) = M$: RETURN
- 11500 NO$ = LEFT$ (M$,3) + "01"
- 11510 GOSUB 1000:T = INT (T + .5)
- 11520 J = LEN (M$):I = VAL ( MID$ (M$,4,2)):I = I - 1
- 2573 - IF I = 0 THEN M$ = RIGHT$ (M$,J - 5): GOTO 11560
- 11540 A$ = STR$ (I): IF I < 10 THEN A$ = "0" + A$
- 11550 M$ = LEFT$ (M$,3) + A$ + RIGHT$ (M$,J - 5)
- 11560 MO$(O) = M$: RETURN
- 11800 IF TT% > TU% THEN RETURN
- 11810 UU = TI% - 1: IF TI% = 0 THEN 11910
- 11820 FOR U = 0 TO UU
- 11822 IF TX(U) = 69000 THEN 11900
- 11830 Z = TZ%(U)
- 11840 Z2 = 450 - Z
- 11850 L0 = 30 * .5555 * 6
- 11860 X = TX(U) + L0 * COS (Z2 * PI / 180)
- 11870 Y = TY(U) + L0 * SIN (Z2 * PI / 180)
- 11880 TX(U) = X:TY(U) = Y
- 11900 NEXT
- 11910 TT% = TT% + 6: GOTO 11800
- 12000 PRINT "COLLISION CHECK TIME=";TU% - 3
- 12010 UU = NE% - 1
- 12100 FOR U = 0 TO UU
- 12110 IF XN(U) = 69000 THEN 12130
- 12120 CC = 0: GOSUB 12700
- 25195 / NEXT
- 12200 UU = US%
- 12210 FOR U = UU TO UT
- 12220 IF XN(U) = 69000 THEN 12240
- 12230 CC = NE%: GOSUB 12700
- 12240 NEXT
- 12299 RETURN
- 12700 FOR C = CC TO UT: REM CHECK SHIPS **
- 12710 IF C = U THEN 12900
- 12720 IF XN(C) = 69000 THEN 12900
- 12730 IF ABS (XN(U) - XN(C)) > 150 THEN 12900
- 12740 IF ABS (YN(U) - YN(C)) > 150 THEN 12900
- 12748 J = VAL ( MID$ (U$(C),SM,3))
- 12750 I = VAL ( MID$ (U$(U),SM,3)): IF I = 0 THEN 12800
- 12760 IF J = 0 THEN 12900
- 12770 IF ABS (I - J) > 100 THEN 12900
- 12780 U$ = U$(U): GOSUB 50510:VS% = VS% + V
- 12781 FLASH : PRINT "SUBS COLLIDED U/W": NORMAL
- 12782 A = U:U = C
- 12784 U$ = U$(U): GOSUB 50510:VS% = VS% + V:U = A: GOTO 12900
- 12800 IF J < > 0 THEN 12900
- 12802 FLASH : PRINT "SHIPS COLLIDED ON SURFACE": NORMAL :UP$ = "U": IF U > = US% THEN UP$ = "S"
- 2573 2 GOSUB 50500: GOSUB 50600
- 12812 A = U:U = C:UP$ = "U": IF U > = US% THEN UP$ = "S"
- 12814 GOSUB 50500: GOSUB 50600:U = A
- 12900 NEXT
- 12910 RETURN
- 14000 UN$(U) = LEFT$ (UN$(U),1) + MID$ (M$,4,2) + RIGHT$ (UN$(U),3)
- 14010 I = LEN (M$):MO$(O) = RIGHT$ (MO$(O),I - 5): RETURN
- 14200 D = VAL ( MID$ (U$,SM,3)): IF D < > 0 THEN 14300
- 14210 I = VAL ( MID$ (U$,SI,2)):J = VAL ( MID$ (U$,SJ,2)):K = I: IF I > J THEN K = J
- 14230 A$ = "00" + STR$ (K):UN$(U) = "3" + RIGHT$ (A$,2) + RIGHT$ (UN$(U),3)
- 14300 U$(U) = LEFT$ (U$(U),SM - 1) + MID$ (M$,3,3) + RIGHT$ (U$(U),S9 - SM - 2)
- 14310 I = LEN (M$):MO$(O) = RIGHT$ (MO$(O),I - 5): RETURN
- 15000 UU = NE% - 1
- 15100 FOR O = 0 TO UU
- 15102 IF UX(O) = 69000 THEN 15900
- 15110 IF FO$(O) = "" THEN 15900
- 15120 F$ = FO$(O):AB = 1
- 15130 K = VAL ( MID$ (F$,AB + 3,1)) * 10
- 15140 IF K > TU% THEN 15160
- 15150 GOTO 15200
- 15160 J = LEN (F$):AB = AB + 7: IF AB < J THEN 15130
- 15170 GOTO 15900
- 15200 Z = VAL ( MID$ (UN$(O),4,3)):NO$ = MID$ (F$,AB,7)
- 15210 IF LEFT$ (NO$,2) < > "FD" THEN 15300
- 15220 Z1 = Z + 180: IF Z1 > 360 THEN Z1 = Z1 - 360
- 15230 Z2 = 450 - Z1
- 15240 J = 60: GOSUB 15700
- 15250 GOTO 15800
- 15300 IF LEFT$ (NO$,2) < > "FA" THEN 15400
- 15310 J = VAL ( MID$ (NO$,5,3)) + 50
- 15320 Z2 = 450 - Z
- 15330 GOSUB 15700
- 15340 GOTO 15800
- 15400 IF LEFT$ (NO$,2) < > "FK" THEN STOP
- 15410 J = Z + 90: IF J > 360 THEN J = J - 360
- 15420 Z2 = 450 - J
- 15430 J = 100: GOSUB 15700
- 15440 J = Z - 90: IF J < 0 THEN J = J + 360
- 15450 Z2 = 450 - J
- 15460 J = 100: GOSUB 15700
- 15470 GOTO 15800
- 15700 X = XN(O) + J * COS (Z2 * PI / 180): REM EXPLODE & UPDATE ******
- 15710 Y = YN(O) + J * SIN (Z2 * PI / 180)
- 15720 WX(WI%) = X:WY(WI%) = Y
- 15730 D = VAL ( MID$ (NO$,5,3)):WZ(WI%) = D
- 15740 IF LEFT$ (NO$,2) = "FA" THEN WZ(WI%) = - 69:WT%(WI%) = TU% + 7: GOTO 15760
- 15750 I = INT (D / 10):WT%(WI%) = I + TU% + 7
- 15760 WI% = WI% + 1: IF WI% > 19 THEN WI% = 19
- 15770 RETURN
- 15800 I = LEN (F$):F$ = LEFT$ (F$,AB + 2) + "9" + RIGHT$ (F$,I - AB - 3): REM UPDATE ORDER
- 15810 FO$(O) = F$: GOTO 15160
- 15900 NEXT
- 15910 RETURN
- 16000 CC = NE%:UU = CO% - 1
- 16100 FOR O = CC TO UU
- 16110 IF FO$(O) = "" THEN 16400
- 16120 F$ = FO$(O):AB = 1
- 16130 K = VAL ( MID$ (F$,AB + 6,2))
- 16140 IF K + 10 > TU% THEN 16160
- 16150 GOTO 16200
- 16160 J = LEN (F$):AB = AB + 8: IF AB < J THEN 16130
- 16170 GOTO 16400
- 16200 J = O + NF% + NT%:Z = VAL ( RIGHT$ (UN$(J),3))
- 16210 D = 150: IF MID$ (F$,AB + 2,1) = "B" THEN 16230
- 16220 D = - 150:Z = Z + 180: IF Z > 360 THEN Z = Z - 360
- 16230 Z2 = 450 - Z: IF Z2 = 360 OR Z2 = 180 THEN Z2 = 0
- 16232 IF XN(J) = 69000 THEN 16400
- 16234 VS% = VS% + 1: FLASH : PRINT "TORPEDO AWAY": NORMAL : GOSUB 16800: IF TI% > = 19 THEN 16300
- 16236 Z0 = VAL ( RIGHT$ (UN$(J),3)): IF MID$ (F$,AB + 2,1) = "S" THEN Z0 = Z0 + 180
- 16237 I = ABS (Z0 - Z): IF I > 180 THEN I = 360 - I
- 16238 IF I > 120 THEN 16300
- 16240 X = XN(J) + D * COS (Z2 * PI / 180)
- 16250 Y = YN(J) + D * SIN (Z2 * PI / 180)
- 16260 TX(TI%) = X:TY(TI%) = Y:TZ%(TI%) = VAL ( MID$ (F$,AB + 3,3))
- 16270 TI% = TI% + 1: IF TI% > = 19 THEN TI% = 19
- 16272 A$ = LEFT$ (TA$,TI%) + "8000000000000000000000":TA$ = LEFT$ (A$,22)
- 16300 I = LEN (F$): IF I = AB + 7 THEN 16304
- 16302 F$ = LEFT$ (F$,AB + 5) + "99" + RIGHT$ (F$,I - AB - 7): GOTO 16310
- 16304 F$ = LEFT$ (F$,AB + 5) + "99"
- 16310 FO$(O) = F$: GOTO 16160
- 16400 NEXT
- 16410 RETURN
- 16800 A$ = TB$(J - US%): IF MID$ (F$,AB + 2,1) = "S" THEN A$ = TS$(J - US%)
- 16810 X = 2
- 16820 IF MID$ (A$,X,1) = "L" THEN 16840
- 16830 X = X + 1: IF X < 11 THEN 16820
- 16832 STOP
- 16840 A$ = LEFT$ (A$,X - 1) + "F" + RIGHT$ (A$,11 - X)
- 16850 IF MID$ (F$,AB + 2,1) = "B" THEN TB$(J - US%) = A$: GOTO 16870
- 16860 IF MID$ (F$,AB + 2,1) = "S" THEN TS$(J - US%) = A$: GOTO 16870
- 16865 STOP
- 16870 RETURN
- 19000 REM CHAIN **
- 19010 TEXT : HOME :I = FRE (0)
- 19100 VTAB 12: HTAB 10: INVERSE : PRINT " LOADING SEARCH PHASE "
- 19110 NORMAL
- 19200 & GOTO "P5"
- 20000 AB = WI% - 1: IF AB = - 1 THEN RETURN
- 20110 FOR U = 0 TO UT
- 20112 U$ = U$(U): IF XN(U) = 69000 THEN 20310
- 20120 FOR DC = 0 TO AB
- 20122 IF TU% < WT%(DC) THEN 20300
- 20124 IF WT%(DC) = 6969 THEN STOP 20300
- 20126 IF WZ(DC) = - 69 THEN WZ(DC) = 0:WT%(DC) = - 69
- 20130 X0 = XN(U):Y0 = YN(U):X1 = WX(DC):Y1 = WY(DC)
- 20132 D = SQR ((X0 - X1) ^ 2 + (Y0 - Y1) ^ 2)
- 20140 IF D > 75 THEN 20300
- 20142 IF QB% = 69 THEN 20200
- 20144 IF D > 50 THEN 20300
- 20200 I = VAL ( MID$ (U$(U),SM,3))
- 20210 D0 = ABS (I - WZ(DC)): IF D0 > 75 THEN 20300
- 20212 IF QB% = 69 THEN 20220
- 20214 IF D0 > 50 THEN 20300
- 20220 GOSUB 20500
- 20230 WT%(DC) = 6969: GOSUB 60000: GOSUB 58000
- 20300 NEXT DC
- 20310 NEXT U
- 24696 O FOR DC = 0 TO AB
- 20330 IF WT%(DC) = 6969 THEN 20360
- 20332 IF WT%(DC) < > - 69 THEN 20340
- 20334 WZ(DC) = WZ(DC) + 30: IF WZ(DC) > 999 THEN 20350
- 20336 GOTO 20360
- 20340 IF TU% < WT%(DC) THEN 20360
- 20350 WT%(DC) = 6969: GOSUB 60000: GOSUB 58000
- 20360 NEXT : RETURN
- 20500 IF D > 50 THEN D = 45: REM U/W CRT
- 20502 IF D0 > 50 THEN D0 = 45
- 20503 IF WT%(DC) = - 69 THEN D0 = 11
- 20504 I = 100 - D - D0:J = I / 100:K = VAL ( MID$ (U$,SX,1)) / 10:Q = RND (1) + .5
- 20510 X0 = J * 20 * K * Q:X1 = INT (X0 + .5)
- 20520 Y0 = VAL ( MID$ (U$,SV,2)):Y1 = Y0 - X1: IF Y1 < 1 THEN 20600
- 20530 A$ = "00" + STR$ (Y1):U$ = LEFT$ (U$,SV - 1) + RIGHT$ (A$,2) + RIGHT$ (U$,S9 - SV - 1)
- 20540 U$(U) = U$: RETURN
- 20600 FLASH : PRINT "SHIP SUNK BY DC":UP$ = "S": NORMAL
- 20610 GOSUB 50500: GOSUB 50600: GOTO 20540
- 21000 IF TI% = 0 THEN RETURN
- 21100 CC = TI% - 1:UU = US% - 1
- 21110 FOR AB = 0 TO CC
- 21112 IF TX(AB) = 69000 THEN 21410
- 21120 FOR U = 0 TO UU
- 21122 U$ = U$(U):UN$ = UN$(U): IF XN(U) = 69000 THEN 21400
- 21130 X0 = XN(U):Y0 = YN(U):X1 = TX(AB):Y1 = TY(AB)
- 21140 D = SQR ((X0 - X1) ^ 2 + (Y0 - Y1) ^ 2)
- 21150 IF D > 150 THEN 21400
- 21160 D0 = VAL ( RIGHT$ (UN$,3)):J = VAL ( MID$ (U$,SX,1)) / 10:I = ABS (D0 - TZ%(AB))
- 43643 R IF I > 90 THEN I = I - 90: GOTO 21162
- 21170 I = I + 10:K = I * J:Q = RND (1) * 100
- 21172 IF NU$ = "A" AND TP$ < > "3" THEN K = K / 2
- 21180 IF Q < = K THEN 21190
- 21182 I = Q - K: FLASH : IF I < 11 THEN PRINT "TORPEDO NARROWLY MISSED ";: GOTO 21185
- 21183 IF I < 34 THEN PRINT "TORPEDO CAME CLOSE TO ";: GOTO 21185
- 21184 PRINT "TORPEDO WENT WIDE OF ";
- 21185 PRINT MID$ (U$,SB,2): NORMAL
- 21186 Z = 450 - TZ%(AB):TX(AB) = TX(AB) + 400 * COS (Z * PI / 180):TY(AB) = TY(AB) + 400 * SIN (Z * PI / 180)
- 21188 GOTO 21400
- 21190 X0 = 30 * ( RND (1) + .5):X1 = INT (X0 + .5): GOSUB 60500
- 21200 Y0 = VAL ( MID$ (U$,SV,2)):Y1 = Y0 - X1: IF Y1 < 1 THEN 21300
- 21210 A$ = "00" + STR$ (Y1):U$ = LEFT$ (U$,SV - 1) + RIGHT$ (A$,2) + RIGHT$ (U$,S9 - SV - 1)
- 21212 TX(AB) = 69000: GOSUB 21800
- 21215 FLASH : PRINT "TORPEDO HIT "; MID$ (U$,SB,2): NORMAL
- 21220 U$(U) = U$: GOTO 21400
- 21300 FLASH : PRINT MID$ (U$,SB,2);" SUNK BY TORPEDO":UP$ = "U": NORMAL
- 21302 TX(AB) = 69000
- 21310 GOSUB 50500: GOSUB 50600: GOTO 21400
- 21400 NEXT U
- 21410 NEXT AB
- 21420 RETURN
- 21800 IF U > = NE% THEN RETURN
- 21810 I = INT ((X1 * RND (1)) + .5):J = VAL ( MID$ (U$,SH,2)):K = J - I: IF K < 1 THEN K = 0
- 21820 A$ = "00" + STR$ (K):U$ = LEFT$ (U$,SH - 1) + RIGHT$ (A$,2) + RIGHT$ (U$,S9 - SH - 1)
- 21830 J = VAL ( MID$ (UN$,2,2)): IF J < = K THEN RETURN
- 21840 U$ = LEFT$ (U$,SI - 1) + RIGHT$ (A$,2) + RIGHT$ (U$,S9 - SI - 1)
- 21850 UN$ = LEFT$ (UN$,1) + RIGHT$ (A$,2) + RIGHT$ (UN$,3):UN$(U) = UN$: RETURN
- 24000 CC = CO% - 1: IF RND (1) > .5 THEN 24010: REM FSS CRT **
- 24002 FOR O = CC TO 0 STEP - 1
- 24004 GOTO 24020
- 24010 FOR O = 0 TO CC
- 24020 F$ = FS$(O): IF F$ = "" THEN 24060
- 24030 A = LEN (F$):B = 1
- 24040 IF MID$ (F$,B,3) = "FSG" THEN 24100
- 24050 B = B + 10: IF B < = (A) THEN 24040
- 24060 NEXT O
- 24070 RETURN
- 24100 Z = VAL ( MID$ (F$,B + 3,3)):D = VAL ( MID$ (F$,B + 6,4))
- 24110 IF O < NE% THEN U = O: GOTO 24130
- 24120 I = O - NE%:U = US% + I
- 24130 U$ = U$(U):UN$ = UN$(U):X = UX(U):Y = UY(U): IF X = 69000 THEN 24060
- 24131 PRINT MID$ (U$,SB,2);" FIRING SURFACE GUNS": GOSUB 60500
- 24132 J = VAL ( MID$ (U$,SM,3)): IF J < > 0 THEN 24060
- 24140 Z2 = 450 - Z: IF Z2 > = 360 THEN Z2 = Z2 - 360
- 24150 X0 = X + D * COS (Z2 * PI / 180):Y0 = Y + D * SIN (Z2 * PI / 180)
- 24200 FOR I = 0 TO UT
- 24202 IF UX(I) = 69000 THEN 24310
- 24204 J = VAL ( MID$ (U$(I),SM,3)): IF J < > 0 THEN 24310
- 24210 IF ABS (UX(I) - X0) > 150 THEN 24310
- 24220 IF ABS (UY(I) - Y0) > 150 THEN 24310
- 24230 D0 = SQR ((UX(I) - X0) ^ 2 + (UY(I) - Y0) ^ 2)
- 24240 J = (150 - D0) / 500:Q = RND (1) + .5
- 24250 K = VAL ( MID$ (U$(U),SW,2)):C = J * K * Q
- 24260 L1 = INT (C + .5): IF L1 < 1 THEN 24310
- 24270 U$ = U$(I):K1 = VAL ( MID$ (U$,SV,2)):DC = K1 - L1: IF DC < 1 THEN 24400
- 24280 A$ = "00" + STR$ (DC):U$ = LEFT$ (U$,SV - 1) + RIGHT$ (A$,2) + RIGHT$ (U$,S9 - SV - 1)
- 24300 U$(I) = U$
- 24305 FLASH : PRINT "SURFACE GUN HIT "; MID$ (U$,SB,2): NORMAL
- 24310 NEXT I
- 24320 GOTO 24060
- 24400 PRINT MID$ (U$,SB,2);" SUNK BY SURFACE GUNS":UP$ = "U": IF I > = US% THEN UP$ = "S"
- 24405 REM
- 24410 J = U:U = I: GOSUB 50500:I = U:U = J: GOSUB 50600: GOTO 24310
- 28000 IF LEFT$ (M$,2) < > "MC" THEN RETURN
- 28010 C$ = LEFT$ (M$,5):A = LEN (M$): IF A = 5 THEN M$ = "": GOTO 28030
- 28020 M$ = RIGHT$ (M$,A - 5)
- 28030 D0 = VAL ( RIGHT$ (UN$,3)):D = VAL ( MID$ (C$,3,3))
- 28040 IF D0 > D THEN A$ = "P"
- 28050 IF D0 < D THEN A$ = "S"
- 28060 IF D0 = D THEN MO$(O) = M$: RETURN
- 28070 J = ABS (D0 - D): IF J < = 180 THEN 28100
- 28080 J = D0 + 360 - D: IF J < 180 THEN A$ = "P": GOTO 28100
- 28090 J = D + 360 - D0: IF J < 180 THEN A$ = "S": GOTO 28100
- 28095 STOP
- 28100 GOSUB 29000:K = 0:D$ = ""
- 28110 K = K + 10: IF K > = I THEN 28140
- 28120 IF K > = J THEN 28200
- 28130 GOTO 28110
- 28140 A = INT (K / 10):B$ = "00" + STR$ (A)
- 28150 D$ = D$ + "MD" + A$ + RIGHT$ (B$,2):K = 0:J = J - I: IF J = 0 THEN 28260
- 28160 K = 0: GOTO 28110
- 28200 A = INT (K / 10):B$ = "00" + STR$ (A)
- 28210 D$ = D$ + "MD" + A$ + RIGHT$ (B$,2)
- 28220 A = ABS (K - J): IF A = 0 THEN 28260
- 28230 B$ = "0" + STR$ (A)
- 28240 A$ = MID$ (D$,3,1)
- 28250 D$ = D$ + "MXX" + A$ + RIGHT$ (B$,1)
- 28260 M$ = D$ + M$:MO$(O) = M$: RETURN
- 29000 A = VAL ( MID$ (U$,SG,1)): IF A < 1 OR A > 9 THEN STOP
- 21125 q ON A GOTO 29011,29012,29013,29014,29015,29016,29017,29018,29019
- 29011 I = 6: GOTO 29020
- 29012 I = 18: GOTO 29020
- 29013 I = 30: GOTO 29020
- 29014 I = 60: GOTO 29020
- 29015 I = 90: GOTO 29020
- 29016 I = 120: GOTO 29020
- 29017 I = 180: GOTO 29020
- 29018 I = 360: GOTO 29020
- 29019 I = 720
- 29020 RETURN
- 32000 K0 = VAL ( MID$ (UN$(O),2,2)): REM CHANGE SPEED ORDER **
- 2573 }K1 = VAL ( MID$ (M$,4,2))
- 32020 IF MID$ (M$,3,1) = "P" THEN K = K0 + K1
- 32030 IF MID$ (M$,3,1) = "M" THEN K = K0 - K1
- 32040 IF K < 1 THEN K = 0
- 32050 K1 = VAL ( MID$ (U$(O),SH,2))
- 32060 IF K > K1 THEN K = K1
- 32070 B$ = STR$ (K): IF K < 1 THEN B$ = "000"
- 32080 UN$(O) = LEFT$ (UN$(O),1) + RIGHT$ (B$,2) + RIGHT$ (UN$(O),3)
- 32100 I = LEN (M$):MN$(O) = RIGHT$ (M$,I - 5)
- 32110 RETURN
- 34000 D0 = VAL ( RIGHT$ (UN$,3)):D = VAL ( MID$ (M$,5,1))
- 34010 IF MID$ (M$,4,1) = "P" THEN D0 = D0 + D
- 58503 INPUT IF MID$ (M$,4,1) = "S" THEN D0 = D0 - D
- 34030 A$ = "00" + STR$ (D0):UN$ = LEFT$ (UN$,3) + RIGHT$ (A$,3)
- 34040 A = LEN (M$):M$ = RIGHT$ (M$,A - 5)
- 34050 UN$(U) = UN$:MO$(O) = M$: RETURN
- 35000 UU = UT% + NT% + NF% - 1:CC = UT%
- 35070 FOR U = CC TO UU
- 35080 IF XN(U) = 69000 THEN 35100
- 2573 TEXT D0 = VAL ( RIGHT$ (UN$(U),3)):D = VAL ( MID$ (MO$(O),5,1)): IF MID$ (MO$(O),4,1) = "P" THEN K = D0 + D: GOTO 35086
- 35084 IF MID$ (MO$(O),4,1) = "S" THEN K = D0 - D: GOTO 35086
- 2573 TEXT STOP
- 35086 A$ = "00" + STR$ (K):UN$(U) = LEFT$ (UN$(U),3) + RIGHT$ (A$,3)
- 35100 NEXT
- 35110 MO$(O) = "MDC60MDC60": RETURN
- 36000 U = US%: REM FORCE SUB TO SURFACE **
- 36002 U$ = U$(U): IF UX(U) = 69000 THEN 36110
- 36010 J = VAL ( MID$ (U$,SU,2)):K = 2 * VAL ( MID$ (U$,SV,2)): IF K > J THEN 36110
- 36020 O = NE% + U - US%:M$ = "12345" + MO$(O) + "67890":M = LEN (M$):B = 1
- 36030 IF MID$ (M$,B,2) < > "MU" THEN 36050
- 36040 M$ = LEFT$ (M$,B - 1) + RIGHT$ (M$,M - B - 4):M = M - 5:B = B - 5
- 36050 B = B + 5: IF B < = M THEN 36030
- 36070 D0 = VAL ( MID$ (U$,SM,3)):D = VAL ( MID$ (U$,SP,3)):P = D0 - D: IF P < 0 THEN P = 0
- 36090 A$ = "000" + STR$ (P): IF M = 10 THEN MO$(O) = "MU" + RIGHT$ (A$,3) + "MDC60MDC60": GOTO 36110
- 36100 MO$(O) = "MU" + RIGHT$ (A$,3) + MID$ (M$,6,M - 10)
- 36110 U = U + 1: IF U < = UT THEN 36002
- 36120 M$ = "": RETURN
- 36500 FOR I = 0 TO UT: REM DEAD IN WATER **
- 36510 IF UX(I) = 69000 THEN 36550
- 36520 J = VAL ( MID$ (U$(I),SV,2)): IF J > 4 THEN 36550
- 36530 U$(I) = LEFT$ (U$(I),SH - 1) + "0000" + RIGHT$ (U$(I),S9 - SH - 3)
- 36532 UN$(I) = LEFT$ (UN$(I),1) + "00" + RIGHT$ (UN$(I),3)
- 36534 IF I < NE% THEN MO$(I) = "MDC60MDC60"
- 36536 IF I > = US% THEN MO$(I - US% + NE%) = "MDC60MDC60"
- 36540 IF I > = US% THEN U$(I) = LEFT$ (U$(I),SK - 1) + "00" + RIGHT$ (U$(I),S9 - SK - 1)
- 36550 NEXT
- 36560 RETURN
- 50500 PRINT MID$ (U$(U),2,2);" SUNK"
- 50510 UX(U) = 69000:UY(U) = 69000:XN(U) = 69000:YN(U) = 69000:U$ = U$(U)
- 50520 U$ = LEFT$ (U$,SV - 1) + "00" + RIGHT$ (U$,S9 - SV - 1): REM DP'S = 0
- 50530 V = VAL ( MID$ (U$,SF,2))
- 50540 U$(U) = U$: RETURN
- 50600 IF UP$ = "U" THEN 50620: REM ADD VP'S **
- 50610 VS% = VS% + V: GOTO 50630
- 50620 VU% = VU% + V
- 50630 PRINT V;" VP'S AWARDED TO ";
- 50640 IF UP$ = "U" THEN PRINT "UNDERWATER";: GOTO 50660
- 50650 PRINT "SURFACE";
- 50660 PRINT " SIDE"
- 50690 RETURN
- 57000 VTAB 24: PRINT "THIS WILL TAKE 1-5 MINUTES."
- 57002 I = FRE (0)
- 57010 PRINT : PRINT : RETURN
- 58000 FOR X1 = 0 TO UT
- 58010 IF UX(X1) = 69000 THEN 58100
- 58020 J = VAL ( MID$ (U$(X1),SM,3)): IF J < > 0 THEN 58100
- 58030 J = SQR ((XN(X1) - WX(DC)) ^ 2 + (YN(X1) - WY(DC)) ^ 2): IF J > 75 THEN 58100
- 58050 IF QB% = 69 THEN 58070
- 58060 IF J > 50 THEN 58100
- 58070 FLASH : PRINT MID$ (U$(X1),SB,2);" SUNK BY D.C. BACK-WASH!": NORMAL : PRINT "DIS=";J:UP$ = "U": IF X1 > = US% THEN UP$ = "S"
- 58080 X0 = U:U = X1:A$ = U$:U$ = U$(X1): GOSUB 50500: GOSUB 50600:U = X0:U$ = A$
- 58100 NEXT : RETURN
- 60000 GOSUB 60500
- 60020 PRINT "DC DETONATED AT "; INT (WX(DC));","; INT (WY(DC));" DEPTH="; INT (WZ(DC))
- 60030 J = US%
- 60040 FOR I = J TO UT
- 60042 K = SQR ((XN(I) - WX(DC)) ^ 2 + (YN(I) - WY(DC)) ^ 2)
- 60044 IF K > 251 THEN 60060
- 60046 U$(I) = LEFT$ (U$(I),SB% - 1) + "Y" + RIGHT$ (U$(I),S9 - SB%)
- 60048 IF QB% < > 69 THEN 60060
- 60052 K = SQR ((XN(I) - WX(DC)) ^ 2 + (YN(I) - WY(DC)) ^ 2)
- 60054 PRINT " DIS="; INT (K)
- 60060 NEXT
- 60099 POKE - 16301,0: RETURN
- 60500 CALL CLR%: HGR : POKE - 16302,0
- 60510 HCOLOR= 5: HPLOT 0,0 TO 0,0: CALL 62454
- 60520 FOR I = 0 TO 2: HCOLOR= 3: HPLOT 0,0 TO 0,0: CALL 62454: HCOLOR= 5: HPLOT 0,0 TO 0,0: CALL 62454: NEXT
- 60530 TEXT : RETURN
- 18255 = P4
- 4 I = FRE (0): HOME : GOSUB 57000
- 2573
- 21968 S%
- 20 FOR U = 0 TO UT:U$(U) = LEFT$ (U$(U),SB% - 1) + "N" + RIGHT$ (U$(U),S9 - SB%): NEXT
- 100 GOTO 10000
- 1000 UN$ = UN$(U):U$ = U$(U)
- 1010 Z = VAL ( MID$ (UN$,4,3)):K0 = VAL ( MID$ (UN$,2,2))
- 1020 IF MID$ (NO$,3,1) < > "C" THEN 1100
- 1030 T = VAL ( MID$ (NO$,4,2)): IF T > 10 THEN STOP
- 1040 GOTO 1200
- 1100 IF MID$ (NO$,3,1) < > "P" AND MID$ (NO$,3,1) < > "S" THEN STOP
- 1110 GOSUB 29000:A = I
- 1120 J = A / 60:T = 10 / J
- 1130 Z = Z + 10: IF MID$ (NO$,3,1) = "P" THEN Z = Z - 20
- 1140 IF Z > 360 THEN Z = Z - 360
- 1150 IF Z < 0 THEN Z = Z + 360
- 1200 L0 = K0 * .5555 * T:Z2 = 450 - Z: IF Z2 > = 360 THEN Z2 = Z2 - 360
- 1210 X0 = XN(U) + L0 * COS (Z2 * PI / 180)
- 1220 Y0 = YN(U) + L0 * SIN (Z2 * PI / 180)
- 1300 XN(U) = X0:YN(U) = Y0
- 7778 A$ = "000" + STR$ (Z)
- 1330 UN$ = LEFT$ (UN$,3) + RIGHT$ (A$,3)
- 1340 UN$(U) = UN$: RETURN
- 10000 IF MO$(CO%) = "" THEN MO$(CO%) = "MDC60"
- 10002 IF LEFT$ (MO$(CO%),3) < > "MDC" THEN CT% = QP% + 5:MO$(CO%) = MO$(CO%) + "MDC60"
- 10004 IF LEFT$ (MO$(CO%),3) = "MDC" THEN MO$(CO%) = "MDC60MDC60"
- 10010 FOR U = 0 TO UT
- 10012 U$ = U$(U):UN$(U) = LEFT$ (U$,1) + MID$ (U$,SI,2) + MID$ (U$,SN,3):XN(U) = UX(U):YN(U) = UY(U)
- 10013 IF U < US% THEN 10016
- 10014 IF MID$ (U$,SM,3) < > "000" THEN UN$(U) = LEFT$ (U$,1) + MID$ (U$,SK,2) + MID$ (U$,SN,3)
- 10016 NEXT
- 10020 J = CO% - 1
- 10030 FOR I = 0 TO J:MO$(I) = MO$(I) + "MDC60MDC60":TU%(I) = 0: NEXT
- 10032 TU%(CO%) = 0
- 10040 GOSUB 36500: GOSUB 36000: GOSUB 24000
- 10100 TU% = 3:TT% = 2
- 10110 GOSUB 11000
- 32868 ' GOSUB 11800: REM MOVE TORPEDOES
- 10120 GOSUB 12000
- 10130 GOSUB 15000
- 10132 GOSUB 16000: REM TORPEDO FIRE CHAEK
- 10140 GOSUB 20000: REM DEPTH CHARGE COMBAT
- 10150 GOSUB 21000: REM TORPEDO COMBAT
- 10200 TU% = TU% + 3: IF TU% < 61 THEN 10110
- 10202 HGR : POKE - 16302,0
- 10204 FOR I = 5 TO 7
- 10205 HCOLOR= I: HPLOT 0,0 TO 0,0: CALL 62454
- 10206 FOR J = 0 TO 100:X = PEEK ( - 16336): NEXT
- 10207 NEXT : TEXT
- 10220 PRINT : PRINT : PRINT "HIT 'RETURN' FOR SEARCH PHASE ";: INPUT A$
- 10999 GOTO 19000
- 11000 O = 0
- 11100 T = 0: IF TU%(O) < TU% THEN 11130
- 11110 O = O + 1: IF O > CO% THEN RETURN
- 11120 GOTO 11100
- 11130 IF O = CO% THEN 11200
- 11140 IF O < NE% THEN U = O: GOTO 11160
- 11150 I = O - NE%:U = US% + I
- 11160 U$ = U$(U):UN$ = UN$(U)
- 11170 IF XN(U) = 69000 THEN 11110
- 11180 GOSUB 11300
- 11199 TU%(O) = TU%(O) + T: GOTO 11100
- 11200 IF MID$ (MO$(O),3,1) = "C" THEN NO$ = "MDC10": GOTO 11220
- 11202 IF LEFT$ (MO$(O),2) = "MX" THEN GOSUB 35000: GOTO 11200
- 11210 NO$ = LEFT$ (MO$(O),3) + "01"
- 11220 UU = UT% + NT% + NF% - 1:CC = UT%
- 11230 FOR U = CC TO UU
- 11240 IF XN(U) = 69000 THEN 11250
- 11242 IF MID$ (UN$(U),2,2) < > "00" THEN UN$ = UN$(U): GOSUB 1000
- 11250 NEXT
- 11252 IF T = 0 THEN T = 2
- 11260 IF LEFT$ (MO$(O),3) = "MDC" THEN 11290
- 11270 M$ = MO$(O):J = LEN (M$):I = VAL ( MID$ (M$,4,2)):I = I - 1: IF I = 0 THEN M$ = RIGHT$ (M$,J - 5): GOTO 11288
- 11272 A$ = "00" + STR$ (I):M$ = LEFT$ (M$,3) + RIGHT$ (A$,2) + RIGHT$ (M$,J - 5)
- 11288 MO$(O) = M$: IF LEFT$ (M$,2) = "MX" THEN 11202
- 11290 GOTO 11199
- 11300 M$ = MO$(O)
- 11310 IF LEFT$ (M$,3) = "MSS" THEN GOSUB 14000: GOTO 11300
- 11312 IF LEFT$ (M$,3) = "MXX" THEN GOSUB 34000: GOTO 11300
- 11314 IF LEFT$ (M$,2) = "MC" THEN GOSUB 28000: GOTO 11300
- 11320 IF LEFT$ (M$,2) = "MU" THEN GOSUB 14200: GOTO 11300
- 11330 IF LEFT$ (M$,3) < > "MDC" THEN 11500
- 11340 TL = VAL ( MID$ (M$,4,2))
- 11350 IF TL = 1 THEN NO$ = "MDC01": GOTO 11370
- 11360 NO$ = "MDC02"
- 11370 GOSUB 1000
- 11380 I = VAL ( MID$ (NO$,4,2)):TL = TL - I
- 11390 J = LEN (M$): IF TL = 0 THEN M$ = RIGHT$ (M$,J - 5): GOTO 11420
- 11400 A$ = STR$ (TL): IF TL < 10 THEN A$ = "0" + A$
- 11410 M$ = "MDC" + A$ + RIGHT$ (M$,J - 5)
- 11420 MO$(O) = M$: RETURN
- 11500 NO$ = LEFT$ (M$,3) + "01"
- 11510 GOSUB 1000:T = INT (T + .5)
- 11520 J = LEN (M$):I = VAL ( MID$ (M$,4,2)):I = I - 1
- 2573 - IF I = 0 THEN M$ = RIGHT$ (M$,J - 5): GOTO 11560
- 11540 A$ = STR$ (I): IF I < 10 THEN A$ = "0" + A$
- 11550 M$ = LEFT$ (M$,3) + A$ + RIGHT$ (M$,J - 5)
- 11560 MO$(O) = M$: RETURN
- 11800 IF TT% > TU% THEN RETURN
- 11810 UU = TI% - 1: IF TI% = 0 THEN 11910
- 11820 FOR U = 0 TO UU
- 11822 IF TX(U) = 69000 THEN 11900
- 11830 Z = TZ%(U)
- 11840 Z2 = 450 - Z
- 11850 L0 = 30 * .5555 * 6
- 11860 X = TX(U) + L0 * COS (Z2 * PI / 180)
- 11870 Y = TY(U) + L0 * SIN (Z2 * PI / 180)
- 11880 TX(U) = X:TY(U) = Y
- 11900 NEXT
- 11910 TT% = TT% + 6: GOTO 11800
- 12000 PRINT "COLLISION CHECK TIME=";TU% - 3
- 12010 UU = NE% - 1
- 12100 FOR U = 0 TO UU
- 12110 IF XN(U) = 69000 THEN 12130
- 12120 CC = 0: GOSUB 12700
- 25195 / NEXT
- 12200 UU = US%
- 12210 FOR U = UU TO UT
- 12220 IF XN(U) = 69000 THEN 12240
- 12230 CC = NE%: GOSUB 12700
- 12240 NEXT
- 12299 RETURN
- 12700 FOR C = CC TO UT: REM CHECK SHIPS **
- 12710 IF C = U THEN 12900
- 12720 IF XN(C) = 69000 THEN 12900
- 12730 IF ABS (XN(U) - XN(C)) > 150 THEN 12900
- 12740 IF ABS (YN(U) - YN(C)) > 150 THEN 12900
- 12748 J = VAL ( MID$ (U$(C),SM,3))
- 12750 I = VAL ( MID$ (U$(U),SM,3)): IF I = 0 THEN 12800
- 12760 IF J = 0 THEN 12900
- 12770 IF ABS (I - J) > 100 THEN 12900
- 12780 U$ = U$(U): GOSUB 50510:VS% = VS% + V
- 12781 FLASH : PRINT "SUBS COLLIDED U/W": NORMAL
- 12782 A = U:U = C
- 12784 U$ = U$(U): GOSUB 50510:VS% = VS% + V:U = A: GOTO 12900
- 12800 IF J < > 0 THEN 12900
- 12802 FLASH : PRINT "SHIPS COLLIDED ON SURFACE": NORMAL :UP$ = "U": IF U > = US% THEN UP$ = "S"
- 2573 2 GOSUB 50500: GOSUB 50600
- 12812 A = U:U = C:UP$ = "U": IF U > = US% THEN UP$ = "S"
- 12814 GOSUB 50500: GOSUB 50600:U = A
- 12900 NEXT
- 12910 RETURN
- 14000 UN$(U) = LEFT$ (UN$(U),1) + MID$ (M$,4,2) + RIGHT$ (UN$(U),3)
- 14010 I = LEN (M$):MO$(O) = RIGHT$ (MO$(O),I - 5): RETURN
- 14200 D = VAL ( MID$ (U$,SM,3)): IF D < > 0 THEN 14300
- 14210 I = VAL ( MID$ (U$,SI,2)):J = VAL ( MID$ (U$,SJ,2)):K = I: IF I > J THEN K = J
- 14230 A$ = "00" + STR$ (K):UN$(U) = "3" + RIGHT$ (A$,2) + RIGHT$ (UN$(U),3)
- 14300 U$(U) = LEFT$ (U$(U),SM - 1) + MID$ (M$,3,3) + RIGHT$ (U$(U),S9 - SM - 2)
- 14310 I = LEN (M$):MO$(O) = RIGHT$ (MO$(O),I - 5): RETURN
- 15000 UU = NE% - 1
- 15100 FOR O = 0 TO UU
- 15102 IF UX(O) = 69000 THEN 15900
- 15110 IF FO$(O) = "" THEN 15900
- 15120 F$ = FO$(O):AB = 1
- 15130 K = VAL ( MID$ (F$,AB + 3,1)) * 10
- 15140 IF K > TU% THEN 15160
- 15150 GOTO 15200
- 15160 J = LEN (F$):AB = AB + 7: IF AB < J THEN 15130
- 15170 GOTO 15900
- 15200 Z = VAL ( MID$ (UN$(O),4,3)):NO$ = MID$ (F$,AB,7)
- 15210 IF LEFT$ (NO$,2) < > "FD" THEN 15300
- 15220 Z1 = Z + 180: IF Z1 > 360 THEN Z1 = Z1 - 360
- 15230 Z2 = 450 - Z1
- 15240 J = 60: GOSUB 15700
- 15250 GOTO 15800
- 15300 IF LEFT$ (NO$,2) < > "FA" THEN 15400
- 15310 J = VAL ( MID$ (NO$,5,3)) + 50
- 15320 Z2 = 450 - Z
- 15330 GOSUB 15700
- 15340 GOTO 15800
- 15400 IF LEFT$ (NO$,2) < > "FK" THEN STOP
- 15410 J = Z + 90: IF J > 360 THEN J = J - 360
- 15420 Z2 = 450 - J
- 15430 J = 100: GOSUB 15700
- 15440 J = Z - 90: IF J < 0 THEN J = J + 360
- 15450 Z2 = 450 - J
- 15460 J = 100: GOSUB 15700
- 15470 GOTO 15800
- 15700 X = XN(O) + J * COS (Z2 * PI / 180): REM EXPLODE & UPDATE ******
- 15710 Y = YN(O) + J * SIN (Z2 * PI / 180)
- 15720 WX(WI%) = X:WY(WI%) = Y
- 15730 D = VAL ( MID$ (NO$,5,3)):WZ(WI%) = D
- 15740 IF LEFT$ (NO$,2) = "FA" THEN WZ(WI%) = - 69:WT%(WI%) = TU% + 7: GOTO 15760
- 15750 I = INT (D / 10):WT%(WI%) = I + TU% + 7
- 15760 WI% = WI% + 1: IF WI% > 19 THEN WI% = 19
- 15770 RETURN
- 15800 I = LEN (F$):F$ = LEFT$ (F$,AB + 2) + "9" + RIGHT$ (F$,I - AB - 3): REM UPDATE ORDER
- 15810 FO$(O) = F$: GOTO 15160
- 15900 NEXT
- 15910 RETURN
- 16000 CC = NE%:UU = CO% - 1
- 16100 FOR O = CC TO UU
- 16110 IF FO$(O) = "" THEN 16400
- 16120 F$ = FO$(O):AB = 1
- 16130 K = VAL ( MID$ (F$,AB + 6,2))
- 16140 IF K + 10 > TU% THEN 16160
- 16150 GOTO 16200
- 16160 J = LEN (F$):AB = AB + 8: IF AB < J THEN 16130
- 16170 GOTO 16400
- 16200 J = O + NF% + NT%:Z = VAL ( RIGHT$ (UN$(J),3))
- 16210 D = 150: IF MID$ (F$,AB + 2,1) = "B" THEN 16230
- 16220 D = - 150:Z = Z + 180: IF Z > 360 THEN Z = Z - 360
- 16230 Z2 = 450 - Z: IF Z2 = 360 OR Z2 = 180 THEN Z2 = 0
- 16232 IF XN(J) = 69000 THEN 16400
- 16234 VS% = VS% + 1: FLASH : PRINT "TORPEDO AWAY": NORMAL : GOSUB 16800: IF TI% > = 19 THEN 16300
- 16236 Z0 = VAL ( RIGHT$ (UN$(J),3)): IF MID$ (F$,AB + 2,1) = "S" THEN Z0 = Z0 + 180
- 16237 I = ABS (Z0 - Z): IF I > 180 THEN I = 360 - I
- 16238 IF I > 120 THEN 16300
- 16240 X = XN(J) + D * COS (Z2 * PI / 180)
- 16250 Y = YN(J) + D * SIN (Z2 * PI / 180)
- 16260 TX(TI%) = X:TY(TI%) = Y:TZ%(TI%) = VAL ( MID$ (F$,AB + 3,3))
- 16270 TI% = TI% + 1: IF TI% > = 19 THEN TI% = 19
- 16272 A$ = LEFT$ (TA$,TI%) + "8000000000000000000000":TA$ = LEFT$ (A$,22)
- 16300 I = LEN (F$): IF I = AB + 7 THEN 16304
- 16302 F$ = LEFT$ (F$,AB + 5) + "99" + RIGHT$ (F$,I - AB - 7): GOTO 16310
- 16304 F$ = LEFT$ (F$,AB + 5) + "99"
- 16310 FO$(O) = F$: GOTO 16160
- 16400 NEXT
- 16410 RETURN
- 16800 A$ = TB$(J - US%): IF MID$ (F$,AB + 2,1) = "S" THEN A$ = TS$(J - US%)
- 16810 X = 2
- 16820 IF MID$ (A$,X,1) = "L" THEN 16840
- 16830 X = X + 1: IF X < 11 THEN 16820
- 16832 STOP
- 16840 A$ = LEFT$ (A$,X - 1) + "F" + RIGHT$ (A$,11 - X)
- 16850 IF MID$ (F$,AB + 2,1) = "B" THEN TB$(J - US%) = A$: GOTO 16870
- 16860 IF MID$ (F$,AB + 2,1) = "S" THEN TS$(J - US%) = A$: GOTO 16870
- 16865 STOP
- 16870 RETURN
- 19000 REM CHAIN **
- 19010 TEXT : HOME :I = FRE (0)
- 19100 VTAB 12: HTAB 10: INVERSE : PRINT " LOADING SEARCH PHASE "
- 19110 NORMAL
- 19200 & GOTO "P5"
- 20000 AB = WI% - 1: IF AB = - 1 THEN RETURN
- 20110 FOR U = 0 TO UT
- 20112 U$ = U$(U): IF XN(U) = 69000 THEN 20310
- 20120 FOR DC = 0 TO AB
- 20122 IF TU% < WT%(DC) THEN 20300
- 20124 IF WT%(DC) = 6969 THEN STOP 20300
- 20126 IF WZ(DC) = - 69 THEN WZ(DC) = 0:WT%(DC) = - 69
- 20130 X0 = XN(U):Y0 = YN(U):X1 = WX(DC):Y1 = WY(DC)
- 20132 D = SQR ((X0 - X1) ^ 2 + (Y0 - Y1) ^ 2)
- 20140 IF D > 75 THEN 20300
- 20142 IF QB% = 69 THEN 20200
- 20144 IF D > 50 THEN 20300
- 20200 I = VAL ( MID$ (U$(U),SM,3))
- 20210 D0 = ABS (I - WZ(DC)): IF D0 > 75 THEN 20300
- 20212 IF QB% = 69 THEN 20220
- 20214 IF D0 > 50 THEN 20300
- 20220 GOSUB 20500
- 20230 WT%(DC) = 6969: GOSUB 60000: GOSUB 58000
- 20300 NEXT DC
- 20310 NEXT U
- 24696 O FOR DC = 0 TO AB
- 20330 IF WT%(DC) = 6969 THEN 20360
- 20332 IF WT%(DC) < > - 69 THEN 20340
- 20334 WZ(DC) = WZ(DC) + 30: IF WZ(DC) > 999 THEN 20350
- 20336 GOTO 20360
- 20340 IF TU% < WT%(DC) THEN 20360
- 20350 WT%(DC) = 6969: GOSUB 60000: GOSUB 58000
- 20360 NEXT : RETURN
- 20500 IF D > 50 THEN D = 45: REM U/W CRT
- 20502 IF D0 > 50 THEN D0 = 45
- 20503 IF WT%(DC) = - 69 THEN D0 = 11
- 20504 I = 100 - D - D0:J = I / 100:K = VAL ( MID$ (U$,SX,1)) / 10:Q = RND (1) + .5
- 20510 X0 = J * 20 * K * Q:X1 = INT (X0 + .5)
- 20520 Y0 = VAL ( MID$ (U$,SV,2)):Y1 = Y0 - X1: IF Y1 < 1 THEN 20600
- 20530 A$ = "00" + STR$ (Y1):U$ = LEFT$ (U$,SV - 1) + RIGHT$ (A$,2) + RIGHT$ (U$,S9 - SV - 1)
- 20540 U$(U) = U$: RETURN
- 20600 FLASH : PRINT "SHIP SUNK BY DC":UP$ = "S": NORMAL
- 20610 GOSUB 50500: GOSUB 50600: GOTO 20540
- 21000 IF TI% = 0 THEN RETURN
- 21100 CC = TI% - 1:UU = US% - 1
- 21110 FOR AB = 0 TO CC
- 21112 IF TX(AB) = 69000 THEN 21410
- 21120 FOR U = 0 TO UU
- 21122 U$ = U$(U):UN$ = UN$(U): IF XN(U) = 69000 THEN 21400
- 21130 X0 = XN(U):Y0 = YN(U):X1 = TX(AB):Y1 = TY(AB)
- 21140 D = SQR ((X0 - X1) ^ 2 + (Y0 - Y1) ^ 2)
- 21150 IF D > 150 THEN 21400
- 21160 D0 = VAL ( RIGHT$ (UN$,3)):J = VAL ( MID$ (U$,SX,1)) / 10:I = ABS (D0 - TZ%(AB))
- 43643 R IF I > 90 THEN I = I - 90: GOTO 21162
- 21170 I = I + 10:K = I * J:Q = RND (1) * 100
- 21172 IF NU$ = "A" AND TP$ < > "3" THEN K = K / 2
- 21180 IF Q < = K THEN 21190
- 21182 I = Q - K: FLASH : IF I < 11 THEN PRINT "TORPEDO NARROWLY MISSED ";: GOTO 21185
- 21183 IF I < 34 THEN PRINT "TORPEDO CAME CLOSE TO ";: GOTO 21185
- 21184 PRINT "TORPEDO WENT WIDE OF ";
- 21185 PRINT MID$ (U$,SB,2): NORMAL
- 21186 Z = 450 - TZ%(AB):TX(AB) = TX(AB) + 400 * COS (Z * PI / 180):TY(AB) = TY(AB) + 400 * SIN (Z * PI / 180)
- 21188 GOTO 21400
- 21190 X0 = 30 * ( RND (1) + .5):X1 = INT (X0 + .5): GOSUB 60500
- 21200 Y0 = VAL ( MID$ (U$,SV,2)):Y1 = Y0 - X1: IF Y1 < 1 THEN 21300
- 21210 A$ = "00" + STR$ (Y1):U$ = LEFT$ (U$,SV - 1) + RIGHT$ (A$,2) + RIGHT$ (U$,S9 - SV - 1)
- 21212 TX(AB) = 69000: GOSUB 21800
- 21215 FLASH : PRINT "TORPEDO HIT "; MID$ (U$,SB,2): NORMAL
- 21220 U$(U) = U$: GOTO 21400
- 21300 FLASH : PRINT MID$ (U$,SB,2);" SUNK BY TORPEDO":UP$ = "U": NORMAL
- 21302 TX(AB) = 69000
- 21310 GOSUB 50500: GOSUB 50600: GOTO 21400
- 21400 NEXT U
- 21410 NEXT AB
- 21420 RETURN
- 21800 IF U > = NE% THEN RETURN
- 21810 I = INT ((X1 * RND (1)) + .5):J = VAL ( MID$ (U$,SH,2)):K = J - I: IF K < 1 THEN K = 0
- 21820 A$ = "00" + STR$ (K):U$ = LEFT$ (U$,SH - 1) + RIGHT$ (A$,2) + RIGHT$ (U$,S9 - SH - 1)
- 21830 J = VAL ( MID$ (UN$,2,2)): IF J < = K THEN RETURN
- 21840 U$ = LEFT$ (U$,SI - 1) + RIGHT$ (A$,2) + RIGHT$ (U$,S9 - SI - 1)
- 21850 UN$ = LEFT$ (UN$,1) + RIGHT$ (A$,2) + RIGHT$ (UN$,3):UN$(U) = UN$: RETURN
- 24000 CC = CO% - 1: IF RND (1) > .5 THEN 24010: REM FSS CRT **
- 24002 FOR O = CC TO 0 STEP - 1
- 24004 GOTO 24020
- 24010 FOR O = 0 TO CC
- 24020 F$ = FS$(O): IF F$ = "" THEN 24060
- 24030 A = LEN (F$):B = 1
- 24040 IF MID$ (F$,B,3) = "FSG" THEN 24100
- 24050 B = B + 10: IF B < = (A) THEN 24040
- 24060 NEXT O
- 24070 RETURN
- 24100 Z = VAL ( MID$ (F$,B + 3,3)):D = VAL ( MID$ (F$,B + 6,4))
- 24110 IF O < NE% THEN U = O: GOTO 24130
- 24120 I = O - NE%:U = US% + I
- 24130 U$ = U$(U):UN$ = UN$(U):X = UX(U):Y = UY(U): IF X = 69000 THEN 24060
- 24131 PRINT MID$ (U$,SB,2);" FIRING SURFACE GUNS": GOSUB 60500
- 24132 J = VAL ( MID$ (U$,SM,3)): IF J < > 0 THEN 24060
- 24140 Z2 = 450 - Z: IF Z2 > = 360 THEN Z2 = Z2 - 360
- 24150 X0 = X + D * COS (Z2 * PI / 180):Y0 = Y + D * SIN (Z2 * PI / 180)
- 24200 FOR I = 0 TO UT
- 24202 IF UX(I) = 69000 THEN 24310
- 24204 J = VAL ( MID$ (U$(I),SM,3)): IF J < > 0 THEN 24310
- 24210 IF ABS (UX(I) - X0) > 150 THEN 24310
- 24220 IF ABS (UY(I) - Y0) > 150 THEN 24310
- 24230 D0 = SQR ((UX(I) - X0) ^ 2 + (UY(I) - Y0) ^ 2)
- 24240 J = (150 - D0) / 500:Q = RND (1) + .5
- 24250 K = VAL ( MID$ (U$(U),SW,2)):C = J * K * Q
- 24260 L1 = INT (C + .5): IF L1 < 1 THEN 24310
- 24270 U$ = U$(I):K1 = VAL ( MID$ (U$,SV,2)):DC = K1 - L1: IF DC < 1 THEN 24400
- 24280 A$ = "00" + STR$ (DC):U$ = LEFT$ (U$,SV - 1) + RIGHT$ (A$,2) + RIGHT$ (U$,S9 - SV - 1)
- 24300 U$(I) = U$
- 24305 FLASH : PRINT "SURFACE GUN HIT "; MID$ (U$,SB,2): NORMAL
- 24310 NEXT I
- 24320 GOTO 24060
- 24400 PRINT MID$ (U$,SB,2);" SUNK BY SURFACE GUNS":UP$ = "U": IF I > = US% THEN UP$ = "S"
- 24405 REM
- 24410 J = U:U = I: GOSUB 50500:I = U:U = J: GOSUB 50600: GOTO 24310
- 28000 IF LEFT$ (M$,2) < > "MC" THEN RETURN
- 28010 C$ = LEFT$ (M$,5):A = LEN (M$): IF A = 5 THEN M$ = "": GOTO 28030
- 28020 M$ = RIGHT$ (M$,A - 5)
- 28030 D0 = VAL ( RIGHT$ (UN$,3)):D = VAL ( MID$ (C$,3,3))
- 28040 IF D0 > D THEN A$ = "P"
- 28050 IF D0 < D THEN A$ = "S"
- 28060 IF D0 = D THEN MO$(O) = M$: RETURN
- 28070 J = ABS (D0 - D): IF J < = 180 THEN 28100
- 28080 J = D0 + 360 - D: IF J < 180 THEN A$ = "P": GOTO 28100
- 28090 J = D + 360 - D0: IF J < 180 THEN A$ = "S": GOTO 28100
- 28095 STOP
- 28100 GOSUB 29000:K = 0:D$ = ""
- 28110 K = K + 10: IF K > = I THEN 28140
- 28120 IF K > = J THEN 28200
- 28130 GOTO 28110
- 28140 A = INT (K / 10):B$ = "00" + STR$ (A)
- 28150 D$ = D$ + "MD" + A$ + RIGHT$ (B$,2):K = 0:J = J - I: IF J = 0 THEN 28260
- 28160 K = 0: GOTO 28110
- 28200 A = INT (K / 10):B$ = "00" + STR$ (A)
- 28210 D$ = D$ + "MD" + A$ + RIGHT$ (B$,2)
- 28220 A = ABS (K - J): IF A = 0 THEN 28260
- 28230 B$ = "0" + STR$ (A)
- 28240 A$ = MID$ (D$,3,1)
- 28250 D$ = D$ + "MXX" + A$ + RIGHT$ (B$,1)
- 28260 M$ = D$ + M$:MO$(O) = M$: RETURN
- 29000 A = VAL ( MID$ (U$,SG,1)): IF A < 1 OR A > 9 THEN STOP
- 21125 q ON A GOTO 29011,29012,29013,29014,29015,29016,29017,29018,29019
- 29011 I = 6: GOTO 29020
- 29012 I = 18: GOTO 29020
- 29013 I = 30: GOTO 29020
- 29014 I = 60: GOTO 29020
- 29015 I = 90: GOTO 29020
- 29016 I = 120: GOTO 29020
- 29017 I = 180: GOTO 29020
- 29018 I = 360: GOTO 29020
- 29019 I = 720
- 29020 RETURN
- 32000 K0 = VAL ( MID$ (UN$(O),2,2)): REM CHANGE SPEED ORDER **
- 2573 }K1 = VAL ( MID$ (M$,4,2))
- 32020 IF MID$ (M$,3,1) = "P" THEN K = K0 + K1
- 32030 IF MID$ (M$,3,1) = "M" THEN K = K0 - K1
- 32040 IF K < 1 THEN K = 0
- 32050 K1 = VAL ( MID$ (U$(O),SH,2))
- 32060 IF K > K1 THEN K = K1
- 32070 B$ = STR$ (K): IF K < 1 THEN B$ = "000"
- 32080 UN$(O) = LEFT$ (UN$(O),1) + RIGHT$ (B$,2) + RIGHT$ (UN$(O),3)
- 32100 I = LEN (M$):MN$(O) = RIGHT$ (M$,I - 5)
- 32110 RETURN
- 34000 D0 = VAL ( RIGHT$ (UN$,3)):D = VAL ( MID$ (M$,5,1))
- 34010 IF MID$ (M$,4,1) = "P" THEN D0 = D0 + D
- 58503 INPUT IF MID$ (M$,4,1) = "S" THEN D0 = D0 - D
- 34030 A$ = "00" + STR$ (D0):UN$ = LEFT$ (UN$,3) + RIGHT$ (A$,3)
- 34040 A = LEN (M$):M$ = RIGHT$ (M$,A - 5)
- 34050 UN$(U) = UN$:MO$(O) = M$: RETURN
- 35000 UU = UT% + NT% + NF% - 1:CC = UT%
- 35070 FOR U = CC TO UU
- 35080 IF XN(U) = 69000 THEN 35100
- 2573 TEXT D0 = VAL ( RIGHT$ (UN$(U),3)):D = VAL ( MID$ (MO$(O),5,1)): IF MID$ (MO$(O),4,1) = "P" THEN K = D0 + D: GOTO 35086
- 35084 IF MID$ (MO$(O),4,1) = "S" THEN K = D0 - D: GOTO 35086
- 2573 TEXT STOP
- 35086 A$ = "00" + STR$ (K):UN$(U) = LEFT$ (UN$(U),3) + RIGHT$ (A$,3)
- 35100 NEXT
- 35110 MO$(O) = "MDC60MDC60": RETURN
- 36000 U = US%: REM FORCE SUB TO SURFACE **
- 36002 U$ = U$(U): IF UX(U) = 69000 THEN 36110
- 36010 J = VAL ( MID$ (U$,SU,2)):K = 2 * VAL ( MID$ (U$,SV,2)): IF K > J THEN 36110
- 36020 O = NE% + U - US%:M$ = "12345" + MO$(O) + "67890":M = LEN (M$):B = 1
- 36030 IF MID$ (M$,B,2) < > "MU" THEN 36050
- 36040 M$ = LEFT$ (M$,B - 1) + RIGHT$ (M$,M - B - 4):M = M - 5:B = B - 5
- 36050 B = B + 5: IF B < = M THEN 36030
- 36070 D0 = VAL ( MID$ (U$,SM,3)):D = VAL ( MID$ (U$,SP,3)):P = D0 - D: IF P < 0 THEN P = 0
- 36090 A$ = "000" + STR$ (P): IF M = 10 THEN MO$(O) = "MU" + RIGHT$ (A$,3) + "MDC60MDC60": GOTO 36110
- 36100 MO$(O) = "MU" + RIGHT$ (A$,3) + MID$ (M$,6,M - 10)
- 36110 U = U + 1: IF U < = UT THEN 36002
- 36120 M$ = "": RETURN
- 36500 FOR I = 0 TO UT: REM DEAD IN WATER **
- 36510 IF UX(I) = 69000 THEN 36550
- 36520 J = VAL ( MID$ (U$(I),SV,2)): IF J > 4 THEN 36550
- 36530 U$(I) = LEFT$ (U$(I),SH - 1) + "0000" + RIGHT$ (U$(I),S9 - SH - 3)
- 36532 UN$(I) = LEFT$ (UN$(I),1) + "00" + RIGHT$ (UN$(I),3)
- 36534 IF I < NE% THEN MO$(I) = "MDC60MDC60"
- 36536 IF I > = US% THEN MO$(I - US% + NE%) = "MDC60MDC60"
- 36540 IF I > = US% THEN U$(I) = LEFT$ (U$(I),SK - 1) + "00" + RIGHT$ (U$(I),S9 - SK - 1)
- 36550 NEXT
- 36560 RETURN
- 50500 PRINT MID$ (U$(U),2,2);" SUNK"
- 50510 UX(U) = 69000:UY(U) = 69000:XN(U) = 69000:YN(U) = 69000:U$ = U$(U)
- 50520 U$ = LEFT$ (U$,SV - 1) + "00" + RIGHT$ (U$,S9 - SV - 1): REM DP'S = 0
- 50530 V = VAL ( MID$ (U$,SF,2))
- 50540 U$(U) = U$: RETURN
- 50600 IF UP$ = "U" THEN 50620: REM ADD VP'S **
- 50610 VS% = VS% + V: GOTO 50630
- 50620 VU% = VU% + V
- 50630 PRINT V;" VP'S AWARDED TO ";
- 50640 IF UP$ = "U" THEN PRINT "UNDERWATER";: GOTO 50660
- 50650 PRINT "SURFACE";
- 50660 PRINT " SIDE"
- 50690 RETURN
- 57000 VTAB 24: PRINT "THIS WILL TAKE 1-5 MINUTES."
- 57002 I = FRE (0)
- 57010 PRINT : PRINT : RETURN
- 58000 FOR X1 = 0 TO UT
- 58010 IF UX(X1) = 69000 THEN 58100
- 58020 J = VAL ( MID$ (U$(X1),SM,3)): IF J < > 0 THEN 58100
- 58030 J = SQR ((XN(X1) - WX(DC)) ^ 2 + (YN(X1) - WY(DC)) ^ 2): IF J > 75 THEN 58100
- 58050 IF QB% = 69 THEN 58070
- 58060 IF J > 50 THEN 58100
- 58070 FLASH : PRINT MID$ (U$(X1),SB,2);" SUNK BY D.C. BACK-WASH!": NORMAL : PRINT "DIS=";J:UP$ = "U": IF X1 > = US% THEN UP$ = "S"
- 58080 X0 = U:U = X1:A$ = U$:U$ = U$(X1): GOSUB 50500: GOSUB 50600:U = X0:U$ = A$
- 58100 NEXT : RETURN
- 60000 GOSUB 60500
- 60020 PRINT "DC DETONATED AT "; INT (WX(DC));","; INT (WY(DC));" DEPTH="; INT (WZ(DC))
- 60030 J = US%
- 60040 FOR I = J TO UT
- 60042 K = SQR ((XN(I) - WX(DC)) ^ 2 + (YN(I) - WY(DC)) ^ 2)
- 60044 IF K > 251 THEN 60060
- 60046 U$(I) = LEFT$ (U$(I),SB% - 1) + "Y" + RIGHT$ (U$(I),S9 - SB%)
- 60048 IF QB% < > 69 THEN 60060
- 60052 K = SQR ((XN(I) - WX(DC)) ^ 2 + (YN(I) - WY(DC)) ^ 2)
- 60054 PRINT " DIS="; INT (K)
- 60060 NEXT
- 60099 POKE - 16301,0: RETURN
- 60500 CALL CLR%: HGR : POKE - 16302,0
- 60510 HCOLOR= 5: HPLOT 0,0 TO 0,0: CALL 62454
- 60520 FOR I = 0 TO 2: HCOLOR= 3: HPLOT 0,0 TO 0,0: CALL 62454: HCOLOR= 5: HPLOT 0,0 TO 0,0: CALL 62454: NEXT
- 60530 TEXT : RETURN
- 45568 PROG = PGA
- 50 I = FRE (0)
- 60 & RECALL "HT": CALL 3072
- 1000 PRINT CHR$ (3);"0": PRINT CHR$ (2);"0": PRINT CHR$ (12)
- 1010 PRINT CHR$ (3);"2": PRINT CHR$ (5): VTAB 4
- 1020 FOR I = 0 TO 3: PRINT CHR$ (9);: NEXT
- 1030 PRINT "TORPEDO FIRE"
- 1040 PRINT CHR$ (20): VTAB 10: HTAB 11
- 1050 PRINT "FINAL VICTORY POINTS"
- 1060 PRINT CHR$ (18)
- 1070 GOSUB 2000
- 1080 INVERSE : VTAB 14: HTAB 12: PRINT "SUBMARINE";: HTAB 23: PRINT "SURFACE"
- 1090 HTAB 14: PRINT "SIDE";: HTAB 24: PRINT "SIDE": NORMAL
- 1100 HTAB 15: PRINT VU%;: HTAB 25: PRINT VS%
- 1200 VTAB 22: PRINT "HIT 'RETURN' FOR A NEW GAME ";: INPUT A$
- 1210 GOTO 19000
- 2000 FOR U = 0 TO UT
- 2010 U$ = U$(U): IF UX(U) = 69000 THEN 2100
- 2020 I = VAL ( MID$ (U$,SU,2)):J = VAL ( MID$ (U$,SV,2)): IF I = J THEN 2100
- 2030 K = VAL ( MID$ (U$,SF,2)):V = INT (K * .5 * ((I - J) / I) + .5)
- 2040 IF U > = US% THEN VS% = VS% + V
- 2050 IF U < US% THEN VU% = VU% + V
- 2100 NEXT
- 2110 RETURN
- 19000 PRINT : PR# 0: IN# 0
- 19100 TEXT : HOME :I = FRE (0): PRINT "MEM=";I
- 19200 VTAB 12: HTAB 11: INVERSE : PRINT " NEW GAME COMING UP ": NORMAL
- 19300 POKE 2048,0: & RUN "P0",2049
- 45568 PROG = SOL
- 4 I = FRE (0)
- 100 GOSUB 60000
- 110 IF QP% < > 0 THEN GOSUB 51000: GOTO 10000
- 200 PI = 3.14159
- 680 TEXT : HOME : PRINT "READING DATA"
- 700 A$ = "SOL-TEST"
- 710 PRINT : PRINT CHR$ (4);"OPEN";A$
- 720 PRINT CHR$ (4);"READ";A$
- 730 INPUT SA: INPUT SB: INPUT SC: INPUT SD: INPUT SE: INPUT SF: INPUT SG
- 740 INPUT SH: INPUT SI: INPUT SJ: INPUT SK: INPUT SL: INPUT SM: INPUT SN: INPUT SO
- 750 INPUT SP: INPUT SQ: INPUT SR: INPUT SS: INPUT ST: INPUT SU: INPUT SV: INPUT SW
- 760 INPUT SX: INPUT SY: INPUT SZ: INPUT SA%: INPUT SB%: INPUT SC%: INPUT SD%: INPUT SE%: INPUT SF%: INPUT S9
- 770 INPUT UT: INPUT NE%: INPUT NT%: INPUT NF%: INPUT NS%
- 780 FOR I = 0 TO UT: INPUT U$(I): NEXT
- 790 FOR I = 0 TO UT: INPUT UX(I): NEXT
- 800 FOR I = 0 TO UT: INPUT UY(I): NEXT
- 810 INPUT B$
- 890 PRINT CHR$ (4);"CLOSE";A$
- 900 UE% = 0:UT% = NE%:UF% = UT% + NT%:US% = NE% + NT% + NF%:CO% = NE% + NS%
- 910 FOR I = 0 TO UT
- 920 U$(I) = LEFT$ (U$(I),SQ - 1) + "D" + RIGHT$ (U$(I),S9 - SQ)
- 930 NEXT
- 940 TB$(0) = "XL23456789X":TS$(0) = "X123456789X"
- 942 UX(5) = 0:UY(2) = 1000
- 949 GOTO 960
- 950 UX(5) = 500:UY(5) = - 1522:U$(5) = LEFT$ (U$(5),SB% - 1) + "Y" + RIGHT$ (U$(5),S9 - SB%)
- 960 U$(0) = LEFT$ (U$(0),SI - 1) + "60" + RIGHT$ (U$(5),S9 - SI - 1)
- 999 GOTO 10000
- 10000 UU = US%: REM MAIN LOOP **
- 10010 FOR U = UU TO UT
- 10020 U$ = U$(U): IF UX(U) = 69000 THEN 10500
- 10030 GOSUB 40000: REM INIT
- 10040 P = VAL ( MID$ (U$,SM,3)): REM ON SURFACE ?
- 10042 IF TD$ = "D" THEN 10050
- 10044 IF P > VAL ( MID$ (U$,SP,3)) THEN 10050
- 10046 IF RND (1) > .25 THEN 10050
- 10048 MO$(O) = "MU000"
- 10050 IF P < > 0 THEN 10100: REM NO
- 10060 GOSUB 43000: REM FSG
- 10080 GOSUB 45000: REM MC(RND)
- 10090 MO$(O) = "MU031" + MO$(O): GOTO 10500:DUCK - IF POS SIBLE
- 10100 I = VAL ( MID$ (U$,SV,2)):J = VAL ( MID$ (U$,SU,2)): REM FORCED UP ?
- 10110 IF 2 * I > J THEN 10200: REM NO
- 10120 GOSUB 44000: REM FIRE ALL TUBES
- 10130 GOSUB 45000: REM MC(RND)
- 10140 GOTO 10500
- 10200 IF MID$ (U$,SY,1) < > "D" THEN 10240: REM MODE=D ?
- 10210 GOSUB 20000: REM YES-DEFENSE
- 10220 GOTO 10400: REM JMP TO FIRE DRILL
- 10240 IF MID$ (U$,SB%,1) < > "Y" THEN 10260: REM WATER DISTURBED ?
- 2573 ( GOTO 10210: REM YES-DEFEND
- 10260 IF MID$ (U$,SY,1) < > "I" THEN 10290: REM MODE=I ?
- 10270 GOSUB 50000: REM COUNT DOWN I MODE
- 10280 GOTO 10500
- 10290 IF P < 31 THEN 10400: REM PERISCOPE DEPTH?
- 10300 GOSUB 46000: REM MU(PER)
- 10310 GOTO 10500: REM (?10410?)
- 10400 GOSUB 42000: REM FIRE DRILL
- 10410 IF B = 0 AND S = 0 THEN GOSUB 48000: GOTO 10500: REM MC(INT)
- 10412 IF F0% = 1 THEN 10500
- 10420 GOSUB 47000: REM MC(VP+)
- 10500 NEXT U
- 10501 GOTO 19000
- 10510 PRINT "ORDERS ARE":J = NE% + NS%
- 10512 FOR I = 0 TO J
- 10520 PRINT I;" MO$=";MO$(I);" FO$=";FO$(I);" FS$=";FS$(I)
- 10530 NEXT
- 10540 PRINT U$
- 10999 PRINT "'RETURN' TO CHAIN ";: INPUT AA$
- 19000 REM CHAIN **
- 19010 TEXT : HOME :I = FRE (0)
- 19100 VTAB 12: HTAB 10: INVERSE : PRINT " LOADING ORDERS PHASE ": HTAB 14: PRINT " SURFACE SIDE ": NORMAL
- 19200 & GOTO "P2"
- 20000 C = VAL ( MID$ (U$,SZ,1)): REM PRINT "** DEFENSE !!": REM
- 20002 IF MID$ (U$,SY,1) < > "D" THEN C = 0
- 20010 IF C = 0 THEN 20100: REM JIF COUNT = 0
- 20020 GOSUB 49000: REM MU(RND)
- 20030 GOSUB 45000: REM MC(RND)
- 20040 C = C - 1:A$ = STR$ (C): REM DECREMENT COUNT
- 20050 U$ = LEFT$ (U$,SZ - 1) + A$ + RIGHT$ (U$,S9 - SZ):U$(U) = U$
- 20060 GOTO 20500
- 20100 IF MID$ (U$,SB%,1) = "Y" THEN 20200: REM JIF DC'S FALLING
- 20102 REM INT "THEY'VE GONE ** RISE !!"
- 20110 GOSUB 46000: REM MU(PER)
- 20120 U$ = LEFT$ (U$,SY - 1) + "A" + RIGHT$ (U$,S9 - SY):U$(U) = U$
- 20130 GOTO 20500
- 20200 IF MID$ (U$,SY,1) < > "D" THEN 20300
- 60009 N REM RINT "DANGER! STAY U/W"
- 20210 C = 2: GOTO 20020
- 20300 U$ = LEFT$ (U$,SY - 1) + "D2" + RIGHT$ (U$,S9 - SY - 1):U$(U) = U$
- 20302 REM RINT "PREPARE TO DIVE"
- 20500 RETURN
- 30000 REM TDC *********************************
- 30002 REM RINT "*** TDC ***"
- 30010 X0 = UX(U):Y0 = UY(U):K0 = VAL ( MID$ (U$,SK,2)):Z0 = VAL ( MID$ (U$,SN,3))
- 30020 XT = UX(T):YT = UY(T):Z1 = VAL ( MID$ (U$(T),SN,3)):K1 = VAL ( MID$ (U$(T),SI,2))
- 30028 REM RINT "BOW/STERN CHECK"
- 30030 X2 = XT:Y2 = YT: GOSUB 30900
- 30040 B$ = "B": IF B = 0 THEN 30100
- 30050 I = ABS (Z0 - A): IF I > 180 THEN I = 360 - I
- 30060 IF I < 120 THEN 30160
- 30100 B$ = "S": IF S = 0 THEN A = 0:Z2 = 0: RETURN : REM ?NO SHOT POSSIBLE
- 30110 Z0 = Z0 + 180: IF Z0 > 360 THEN Z0 = Z0 - 360
- 30120 J = ABS (Z0 - A): IF J > 180 THEN J = 360 - J
- 30130 IF J < 120 THEN 30160
- 30140 A = 0:Z2 = 0: RETURN
- 30141 A = 0:Z2 = 0: PRINT "STERN SHOT IMPOSSIBLE": RETURN
- 30160 I = 450 - Z0: REM INT "SHOT=";B$: PRINT : PRINT
- 30162 X2 = X0 + (100 + 10 * K0 * .5555) * COS (I * PI / 180):X0 = X2
- 30170 Y2 = Y0 + (100 + 10 * K0 * .5555) * SIN (I * PI / 180):Y0 = Y2
- 30200 X1 = XT:Y1 = YT:TT = 0:L1 = 3 * K1 * .5555:L0 = 30 * .5555:Z2 = 450 - Z1
- 30210 GOTO 30240
- 30211 VTAB 23: HTAB 1: PRINT "WORKING ";: INVERSE : PRINT " *";:I = I + 1: IF I > 1 THEN I = 0: GOTO 30230
- 30220 HTAB 9: PRINT "* ";
- 30230 NORMAL
- 30240 X2 = X1 + L1 * COS (Z2 * PI / 180):Y2 = Y1 + L1 * SIN (Z2 * PI / 180):TT = TT + 3
- 30250 D = SQR ((X0 - X2) ^ 2 + (Y0 - Y2) ^ 2):X1 = X2:Y1 = Y2
- 30255 REM RINT "30255 DIS="; INT (D)
- 30260 T0 = D / L0: IF T0 > (TT) AND D < 10000 THEN 30210
- 30270 GOSUB 30900
- 30280 Z2 = ABS (A - Z1): IF Z2 > 180 THEN Z2 = Z2 - 180
- 30300 RETURN
- 30900 IF Y0 = Y2 THEN Y0 = Y0 + 1: REM GET ANGLE $$WHEEL $$
- 30902 AA = ATN ((X0 - X2) / (Y0 - Y2)) * 180 / PI
- 30904 X = INT (X2 - X0 + .5):Y = INT (Y2 - Y0 + .5)
- 30910 AA = INT (AA): IF AA > 0 THEN 30940
- 30912 IF AA = 0 AND X = 0 THEN A = 0: GOTO 30960
- 30920 IF X > = 0 THEN A = 180 + AA: GOTO 30960
- 30922 A = 360 + AA: GOTO 30960
- 30940 IF X > = 0 AND Y > = 0 THEN A = AA: GOTO 30960
- 30942 REM F X < = 0 AND Y < = 0 THEN A = AA: GOTO 30960
- 30943 REM CHECK WITH P3 #####!!!!!!!!3333
- 30950 A = 180 + AA
- 30960 GOTO 30962
- 30961 PRINT "ANGLE FROM "; INT (X0);","; INT (Y0);" TO "; INT (X2);","; INT (Y2): PRINT " = ";A
- 30962 A = INT (A + .5)
- 30970 A = INT (A + .5): RETURN
- 40000 AB = US% - 1: REM INIT **
- 40010 FOR D = 0 TO AB
- 40020 IF UX(D) = 69000 THEN XN(D) = 69000:YN(D) = 0: GOTO 40050
- 40022 A$ = MID$ (U$(D),SQ,1): IF A$ = "X" OR A$ = "S" THEN XN(D) = 69000:YN(D) = 0: GOTO 40050
- 40030 XN(D) = SQR ((UX(U) - UX(D)) ^ 2 + (UY(U) - UY(D)) ^ 2): REM CALC DIS
- 40040 YN(D) = VAL ( MID$ (U$(D),SF,2)): REM VP'S
- 40050 NEXT D
- 40100 A = 1:B = 0: REM BOW TUBES LOADED
- 40110 IF MID$ (TB$(U - US%),A,1) = "L" THEN B = B + 1
- 40120 A = A + 1: IF A < = 10 THEN 40110
- 40130 A = 1:S = 0: REM S=STERN TUBES LOADED
- 40140 IF MID$ (TS$(U - US%),A,1) = "L" THEN S = S + 1
- 40150 A = A + 1: IF A < = 10 THEN 40140
- 40160 F0% = 0
- 40200 O = NE% + U - US%: REM BLANK OLD ORDERS
- 40210 MO$(O) = "":FO$(O) = "":FS$(O) = ""
- 40250 IF MID$ (U$,SJ,2) = MID$ (U$,SK,2) THEN 40299: REM SET SPEED TO MAX
- 40260 IF VAL ( MID$ (U$,SV,2)) < 5 THEN 40299: REM JIF STOPPED
- 40270 A$ = MID$ (U$,SJ,2):U$ = LEFT$ (U$,SK - 1) + A$ + RIGHT$ (U$,S9 - SK - 1):U$(U) = U$: REM SPEED=MAX U/W
- 40299 RETURN
- 40300 FOR I = 0 TO UT - 1: PRINT XN(I),YN(I): NEXT
- 40310 J = NE%:K = J + NS% - 1: FOR I = J TO K: PRINT MO$(I),FO$(I),FS$(I): NEXT
- 40320 PRINT U$
- 40322 PRINT "X="; INT (UX(U));" Y="; INT (UY(U))
- 40330 PRINT "B=";B;" S=";S
- 40400 PRINT "INIT DONE";: INPUT AA$: RETURN
- 41000 Z = VAL ( MID$ (U$(T),SN,3)): REM MOVE TO INTERCEPT **
- 41010 Z0 = Z + 90: IF Z0 > 360 THEN Z0 = Z0 - 360
- 41020 X0 = UX(T) + 1200 * COS ((450 - Z0) * PI / 180): REM CALC 1ST PT
- 41030 Y0 = UY(T) + 1200 * SIN ((450 - Z0) * PI / 180)
- 41040 D0 = SQR ((UX(U) - X0) ^ 2 + (UY(U) - Y0) ^ 2)
- 41050 Z1 = Z - 90: IF Z1 < 0 THEN Z1 = 360 + Z1: REM CALC 2ND PT
- 41060 X1 = UX(T) + 1200 * COS ((450 - Z1) * PI / 180)
- 41070 Y1 = UY(T) + 1200 * SIN ((450 - Z1) * PI / 180)
- 41080 D1 = SQR ((UX(U) - X1) ^ 2 + (UY(U) - Y1) ^ 2)
- 41100 X2 = X0:Y2 = Y0: IF D1 < D0 THEN X2 = X1:Y2 = Y1
- 41110 X0 = UX(U):Y0 = UY(U): GOSUB 30900
- 41112 A = INT (A)
- 41120 A$ = "000" + STR$ (A):MO$(O) = MO$(O) + "MC" + RIGHT$ (A$,3): REM MC(INT)
- 41200 RETURN
- 42000 AB = US% - 1:T = 0: IF B = 0 AND S = 0 THEN 42080: REM FIRE DRILL **
- 42010 D = 600: IF MID$ (U$(T),SB,1) < > "E" THEN D = 1500
- 42020 IF XN(T) > D THEN 42070: REM JIF O.O.R.
- 42030 GOSUB 30000: REM TDC
- 42040 IF Z2 < 45 OR Z2 > 135 THEN 42070: REM ??BAD ANGLE
- 42050 A = INT (A):A$ = "000" + STR$ (A):FO$(O) = FO$(O) + "FT" + B$ + RIGHT$ (A$,3) + "00"
- 42052 REM RINT "TORPEDO FIRE=";FO$(O)
- 42054 IF B$ = "B" THEN B = B - 1
- 42056 IF B$ = "S" THEN S = S - 1
- 42060 IF B = 0 AND S = 0 THEN 42080
- 42070 T = T + 1: IF T < = AB THEN 42010
- 42080 RETURN : REM PRINT "FIRE DRILL OVER": RETURN
- 43000 T = 0: REM FIRE SURFACE GUN **********
- 43010 IF UX(T) = 69000 THEN T = T + 1: GOTO 43010
- 43020 X0 = UX(U):Y0 = UY(U):X2 = UX(T):Y2 = UY(T)
- 43030 D = INT (XN(T))
- 43040 GOSUB 30900: REM GET ANGLE
- 43050 A$ = "000" + STR$ (A):B$ = "0000" + STR$ (D)
- 43060 FS$(O) = "FSG" + RIGHT$ (A$,3) + RIGHT$ (B$,4)
- 43070 RETURN
- 44000 IF B = 0 AND S = 0 THEN 44060: REM FIRE ALL TUBES *******
- 44010 T = US% - 1:AB = - 69
- 44020 IF UX(T) = 69000 THEN 44050
- 44030 GOSUB 42030:T = T - 1: REM FIRE TORP
- 44040 IF B = 0 AND S = 0 THEN 44060
- 44050 T = T - 1: IF T > = 0 THEN 44020
- 44060 RETURN : REM PRINT "ALL SHIPS FIRED AT": RETURN
- 45000 Z = VAL ( MID$ (U$,SN,3)): REM MC(RND) *****
- 45010 I = INT (120 * RND (1)): IF RND (1) > .5 THEN I = - I
- 45020 Z1 = Z + I: IF Z1 > 360 THEN Z1 = Z1 - 360
- 45030 IF Z1 < 0 THEN Z1 = 360 + Z1
- 45040 A$ = "000" + STR$ (Z1):MO$(O) = MO$(O) + "MC" + RIGHT$ (A$,3)
- 45042 REM RINT "MC(RND)=";Z1;" FROM ";Z
- 45050 F0% = 1: RETURN
- 46000 I = VAL ( MID$ (U$,SP,3)): REM I=MRR ** MU(PER) ******
- 46010 J = P - I: IF J < 0 THEN J = 28
- 46020 A$ = "000" + STR$ (J):MO$(O) = "MU" + RIGHT$ (A$,3) + MO$(O)
- 46022 REM RINT "MU(PER) NEW DEPTH=" ;J
- 46030 RETURN
- 47000 AB = US% - 1:T = 0:I = 0:V = YN(0): REM MC(VP+) ********
- 47010 IF UX(T) = 69000 THEN 47030
- 47020 IF YN(T) > V THEN I = T:V = YN(T): REM T=MOST VP'S
- 47030 T = T + 1: IF T < = AB THEN 47010
- 47032 REM RINT MID$ (U$,SB,2);" MC(VP+) TO "; MID$ (U$(I),SB,2)
- 47034 IF V = 0 THEN RETURN
- 47039 REM SET XT&YT TO SHIPS POSITION 1 TURN FROM NOW ??????
- 47040 T = I: GOSUB 41000: REM MOVE TO INTERCEPT
- 47050 RETURN
- 48000 U$ = LEFT$ (U$,SY - 1) + "I" + RIGHT$ (U$,S9 - SY):U$(U) = U$: REM MODE=INTERCEPT
- 48010 T = 0:AB = US% - 1: REM ANYBODY STOPPED ?
- 48020 IF UX(T) = 69000 THEN 48040
- 48030 I = VAL ( MID$ (U$(T),SV,2)): IF I < 5 THEN 48060: REM YES !
- 48040 T = T + 1: IF T < = AB THEN 48020
- 48050 GOTO 48200: REM NOBODY STOPPED
- 48060 XT = UX(T):YT = UY(T): GOSUB 41000: REM MOVE TO INTERCEPT
- 48062 REM RINT MID$ (U$,SB,2);" INTERCEPTING STOPPED "; MID$ (U$(T),SB,2)
- 48070 IF XN(T) > 1500 THEN A$ = "3": GOTO 48100
- 48080 IF XN(T) > 1000 THEN A$ = "2": GOTO 48100
- 48090 A$ = "1"
- 48100 U$ = LEFT$ (U$,SZ - 1) + A$ + RIGHT$ (U$,S9 - SZ):U$(U) = U$: REM MODE COUNT=1 TO 3
- 48110 MO$(O) = "MU033" + MO$(O)
- 48120 GOTO 48299
- 48200 GOSUB 47000: REM MC(VP+)
- 48202 REM RINT MID$ (U$,SB,2);" MODE=INTERCEPTING VP+ "; MID$(U$(T),SB,2)
- 48210 GOTO 48070
- 48299 RETURN
- 49000 I = VAL ( MID$ (U$,SP,3)): REM I=MRR ** MU(RND) **
- 49010 J = INT (I * ( RND (1) + .2)): REM EXPECTED DIVE=70% OF MRR
- 49020 K = P + J:A$ = "000" + STR$ (K): IF K < 31 THEN K = 32:A$ = "0032"
- 49030 MO$(O) = "MU" + RIGHT$ (A$,3) + MO$(O)
- 49032 REM RINT "MU(RND) OLD=";P;" NEW=";K;" MRR=";I;" MDR="; MID$(U$,SO,3)
- 49040 RETURN
- 50000 C = VAL ( MID$ (U$,SZ,1)): REM COUNT DOWN I MODE ****
- 50010 C = C - 1: IF C < 1 THEN 50100
- 50020 A$ = "0" + STR$ (C):U$ = LEFT$ (U$,SZ - 1) + RIGHT$ (A$,1) + RIGHT$ (U$,S9 - SZ):U$(U) = U$
- 50022 REM RINT "INTERCEPT MODE CONTINUING"
- 50030 RETURN
- 50100 GOSUB 46000: REM MU(PER)
- 50110 U$ = LEFT$ (U$,SY - 1) + "A0" + RIGHT$ (U$,S9 - SY - 1):U$(U) = U$
- 50112 REM RINT "INTERCEPT MODE OVER"
- 50120 RETURN
- 51000 J = NE%:K = CO% - 1: REM BLANK ORDERS **
- 51010 FOR I = J TO K:MO$(I) = "":FO$(I) = "": NEXT : RETURN
- 60000 TEXT : REM SOLITAIRE **
- 60002 HOME : VTAB 12: HTAB 12: PRINT "OTTO VON COMPUTER": PRINT
- 60004 HTAB 6: PRINT "SIMULATED SUBMARINE COMMANDER": PRINT
- 60006 HTAB 6: PRINT "IS CRAFTILY MOVING HIS FLEET"
- 27263 MID$ RETURN
- 63001 REM PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
- 63002 REM PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement