home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
SIMTEL
/
CPMUG
/
CPMUG022.ARK
/
BIGTREK.ASC
next >
Wrap
Text File
|
1984-04-29
|
49KB
|
1,444 lines
1 'REWRITE BY ZOSO
2 RANDOMIZE:WIDTH90:LQ=1000
7 DIM G1$(16),V$(5,5),C$(20),G(8,8),D$(12),Q$(10,10),D4(12),D9(106)
10 DIM S2(8,8):Q$="?"
15 DATA S.R. SENSORS,L.R. SENSORS,PHASERS,PHOTON TUBES,LIFE SUPPORT
20 DATA WARP ENGINES,IMPULSE ENGINES,SHIELDS,SUBSPACE RADIO
21 DATA SHUTTLE CRAFT,COMPUTER,TRANSFER PANEL,ABANDON,CHART,COMPUTER
22 DATA DAMAGES,DESTRUCT,DOCK,IDLE,IMPULSE,LRSCAN,NAVIGATE,PHASERS,QUIT
23 DATA SHIELDS,SOS,SRSCAN,STATUS,TORPEDO,TRANSFER,VISUAL,WARP,SHORT
24 DATA MEDIUM,LONG,BEGINNER,NOVICE,SENIOR,EXPERT,COURSE,WCOST,ICOST
25 DATA PEFFECT,SCORE,OUT,ANTARES,SIRIUS,RIGEL,MERAK,PROCYON,CAPELLA
26 DATA VEGA,DENEB,CANOPUS,ALDEBARAN,ALTAIR,REGULUS,BELLATRIX,ARCTURUS
27 DATA POLLUX,SPICA,10.5,12,1.5,9,0,3,7.5,6,4.5
28 DEF FNA(X)=INT(8*RND(X))+1:DEF FNB(X)=INT(10*RND(X))+1
29 DEF FND(X)=X/60
30 DEFFNR(X)=INT(X*10+.5)/10:DEFFNS(X)=INT(X*100+.5)/100
40 FORI=1TO12:READD$(I):NEXT:FORI=1TO20:READC$(I):NEXT
43 FORI=1TO3:READT$(I):NEXT:FORI=1TO4:READS$(I):NEXT:FORI=1TO6
44 READC2$(I):NEXT:FORI=1TO16:READG1$(I):NEXT:FORI=1TO9:READC5(I):NEXT
46 GOSUB24001:S7$(1)="":S7$(2)=" ":S7$(3)=" ":S7$(4)=""
70 IFA2<>0THEN901
75 J4=0:T1=0:INPUT"COMMAND";A$:IFLEN(A$)>1THEN110
80 ?"2 LETTERS, PLEASE.":GOTO75
110 FORI=1TO20
120 IFA$=LEFT$(C$(I),LEN(A$))THEN150
130 NEXT
135 ?"ILLEGAL !! - USE THIS LIST"
140 ?:FORI=1TO20STEP4
141 ?C$(I);TAB(12);C$(I+1);TAB(22);C$(I+2);TAB(32);C$(I+3)
142 NEXT:?:GOTO70
150 ONIGOTO201,226,251,276,291,301,326,351,376,401
160 ONI-10GOTO426,901,476,501,526,545,551,576,601,627
201 GOSUB 35001:GOTO70
226 GOSUB 3001:GOTO70
251 GOSUB5001:GOTO70
276 GOSUB8001:GOTO70
291 GOSUB36001:GOTO70
301 GOSUB7000:GOTO70
326 GOSUB33001:IFJ3=0THEN70
331 IFA2<>0THEN901
332 IFG(Q1,Q2)=1000THEN750
340 GOSUB1000:GOTO70
351 GOSUB13001:IFJ3=0THEN70
353 GOTO710
376 GOSUB14001:GOTO70
401 GOSUB34001
402 IFJ3=0THEN70
410 GOTO710
426 GOSUB20001:IFJ3=0THEN70
428 GOSUB1000:GOTO70
476 GOSUB26001:IFJ3=0THEN70
478 IFA2<>0THEN901
479 GOSUB1000:S9=0:GOTO70
501 GOSUB11001:GOTO70
526 GOSUB29002:GOSUB14001:GOTO70
545 ?:GOSUB37001:GOTO70
551 GOSUB21001:IFJ3=0THEN70ELSE710
576 GOSUB31001:IFJ3=0THEN70
585 IFA2<>0THEN901
590 IFG(Q1,Q2)<>LQTHEN70
595 GOTO750
601 GOSUB32001:IFJ3=0THEN70
603 IFA2<>0THEN901
610 IFG(Q1,Q2)<>LQTHEN70
615 GOTO750
627 GOSUB25010:GOTO70
710 IFA2<>0THEN901
720 IFT1<>0THENGOSUB9000
730 IFA2<>0THEN901
740 IFG(Q1,Q2)<LQTHEN790
750 GOSUB2001:IFA2<>0THEN901
760 IFA2<>0THEN901
770 GOTO740
790 GOSUB1000:GOTO70
901 ?:?:INPUT"ANOTHER GAME ";A$
910 IFLEFT$(A$,1)="Y"THEN46
911 ?CHR$(26):END
1000 IF(C3<>0)AND(J4=0)THENGOSUB16001
1020 IFK3=0THENRETURN
1030 IFA2<>0THENRETURN
1040 P2=1/I8
1050 J5=0
1060 ?
1070 IFC5$="DOCKED"THEN1780
1080 H2=0:H3=0:C6=1
1090 IFS9=1THENC6=.5+.5*RND(1)
1100 A3=0
1110 FORL=1TOK3
1120 IFK6(L)<0THEN1540
1130 A3=1
1140 D6=.8+.05*RND(1)
1150 H4=K6(L)*D6^K8(L)
1160 IF(S4=0)AND(S9=0)THEN1230
1170 P3=.1:IFP2*S3>P3THENP3=P2*S3
1180 H5=P3*C6*H4+1
1190 IFH5>S3THENH5=S3
1195 S3=S3-H5:H4=H4-H5
1210 IF(P3>.1)AND(H4<5E-03*E1)THEN1540
1230 J5=1
1240 ?FNR(H4);"UNIT HIT ON THE ";S5$;" FROM ";
1250 J6=K4(L):J7=K5(L)
1260 IFQ$(J6,J7)="K"THEN?"KLINGON AT";
1270 IFQ$(J6,J7)="C"THEN?"COMMANDER AT";
1280 ?J6;"-";J7
1290 IFH4>H2THENH2=H4
1300 H3=H3+H4
1310 IFH4<(275-25*S8)*(1+.5*RND(1))THEN1530
1320 N4=1+INT(H4/(500+100*RND(1)))
1330 ?"*** CRITICAL HIT--";
1340 K9=1
1350 FORW4=1TON4
1360 J9=INT(12*RND(1))+1
1370 C5(W4)=J9
1380 E3=(H4*D5)/(N4*(75+25*RND(1)))
1390 IFJ9=6THENE3=E3/3
1395 D4(J9)=D4(J9)+E3
1400 IFW4=1THEN1470
1420 FORV=1TOW4
1430 IFJ9=C5(V-1)THEN1480
1440 NEXTV
1450 K9=K9+1
1460 IFK9=3THEN?
1465 ? " AND ";
1470 ?D$(J9);
1480 NEXTW4
1490 ? " DAMAGED."
1500 IFD4(8)=0THEN1530
1510 IFS4<>0THEN?"*** SHIELDS KNOCKED DOWN."
1520 S4=0
1530 E1=E1-H4
1540 NEXTL
1550 IFA3=0THENRETURN
1560 IFE1<=0THEN1750
1570 P4=100*P2*S3+.5
1580 IFJ5<>0THEN1610
1590 ?"ENEMY ATTACK--SHIELDS REDUCED TO ";
1600 GOTO1650
1610 ?"ENERGY LEFT:";FNS(E1);" SHIELDS ";
1620 IFS4<>0THEN?"UP,";
1630 IF(S4=0)AND(D4(8)=0)THEN?"DOWN, ";
1640 IFD4(8)>0THEN?"DAMAGED, ";
1650 ?INT(P4);"%"
1660 IF(H2<200)AND(H3<500)THEN1800
1670 J8=INT(H3*RND(1)*.015)
1680 IFJ8<2THEN1800
1690 ?
1700 ?"---> 'SICKBAY TO BRIDGE. WE SUFFERED ";J8;"CASUALTIES IN THAT ATTACK"
1730 C4=C4+J8
1740 GOTO1800
1750 F9=5
1760 GOSUB10000:RETURN
1780 ?"*** KLINGONS ATTACK-- STARBASE SHIELDS PROTECT THE ";S5$
1800 FORW4=1TOK3
1810 K8(W4)=K7(W4)
1820 NEXTW4
1830 GOSUB28000:RETURN
2001 ?:IFJ4=0THEN2050
2020 ?"*** RED ALERT! RED ALERT!"
2030 ?"*** THE ";S5$;" HAS STOPPED IN QUADRANT CONTAINING SUPERNOVA"
2050 ? "*** AUTO-OVERRIDE ATTEMPTS TO HURL ";S5$;" TO OTHER QUADRANT"
2080 S2(Q1,Q2)=1
2090 GOSUB18000
2100 IFD4(6)=0THEN2290
2110 ?
2120 ?"WARP ENGINES DAMAGED."
2140 ?:?"TRYING TO ENGAGE IMPULSE ENGINES..."
2150 IFD4(7)=0THEN2190
2160 ?"IMPULSE ENGINES DAMAGED."
2165 F9=8
2170 GOSUB10000
2180 RETURN
2190 P2=.75*E1
2200 D6=4E-03*(P2-50)
2210 D7=1.4142+1.2*RND(1)
2220 D1=D6
2230 IFD6>D7THEND1=D7
2240 T1=D1/.4
2250 D2=12*RND(1)
2260 J4=0
2270 GOSUB13200
2280 GOTO2400
2290 W1=6+2*RND(1)
2300 W2=W1*W1
2310 P2=.75*E1
2320 D6=P2/(W1*W1*W1*(S4+1))
2330 D7=1.4142+2*RND(1)
2340 D1=D6
2350 IFD6>D7THEND1=D7
2360 T1=10*D1/W2
2370 D2=12*RND(1)
2380 J4=0
2390 GOSUB34500
2400 IFJ4<>0THEN2440
2410 F9=8
2420 GOSUB10000
2430 RETURN
2440 IFR1<>0THENRETURN
2450 F9=1
2460 GOSUB10000
2470 RETURN
3001 ?:?" 1 2 3 4 5 6 7 8"
3010 ?" --- --- --- --- --- --- --- ---"
3020 FORI=1TO8
3030 ?I;" ";
3040 FORJ=1TO8
3060 ONSGN(S2(I,J))+2GOTO3070,3090,3110
3070 ?" .1.";
3080 GOTO 3160
3090 ?" ...";
3100 GOTO3160
3110 IFS2(I,J)>LQTHEN3150
3120 IFG(I,J)<LQTHEN?S7$(LEN(STR$(G(I,J))));STR$(G(I,J));
3130 IFG(I,J)=LQTHEN?" ***";
3140 GOTO3160
3150 ?S2(I,J)-LQ;
3160 NEXTJ:?:NEXTI:GOSUB18400:?
3190 ?"THE ";S5$;" IS CURRENTLY IN ";G2$;" (";Q1;"-";Q2;")"
3200 RETURN
4001 ?CHR$(26)
4070 S8=0:L2=0
4090 ?"MISSION DURATION...: ";
4095 INPUTA$
4100 FOR I=1TO3
4110 IFA$=LEFT$(T$(I),LEN(A$))THEN4150
4120 NEXTI
4130 ?"WOULD YOU LIKE A SHORT, MEDIUM OR LONG GAME";
4140 GOTO4095
4150 L2=I
4160 ?"ARE YOU A BEGINNER, NOVICE, SENIOR OR EXPERT ";
4170 INPUTA$
4180 FORI=1TO4
4190 IFA$=LEFT$(S$(I),LEN(A$))THEN4220
4200 NEXTI
4210 GOTO4160
4220 S8=I:MR=I
4230 INPUT"ENTER MISSION PASSWORD...";X$:?
4245 ?"....STAND BY...."
4250 J=RND(1)
4280 D5=.5*S8:I2=INT(L2+1+RND(1)*3)
4290 IFI2>5THENI2=5
4300 R3=I2
4310 I5=7*L2
4320 R5=I5
4340 R7=(S8-2*RND(1)+1)*S8*.1+.1
4350 IFR7<.2THENR7=R7+.1
4360 I1=INT(2*R7*I5)
4370 R1=I1
4380 I4=INT(S8+.0625*I1*RND(1))
4390 R2=I4
4400 I3=(I1+4*I4)*I5
4410 R4=I3
4420 RETURN
5001 IFD4(11)=0THEN5030
5010 ?" COMPUTER DISABLED"
5020 RETURN
5030 ?"----COMPUTER ACTIVE----"
5040 INPUT"PROGRAM NAME";B$
5050 FORI=1TO6
5060 IFB$=LEFT$(C2$(I),LEN(B$))THEN5120
5070 NEXT
5080 ?"VALID PROGRAMS ARE:"
5090 ?" COURSE WCOST SCORE"
5100 ?" PEFFECT ICOST OUT"
5110 GOTO5040
5120 ON IGOTO5210,5302,5410,5510,5610,5700
5210 INPUT "ENTER QUADRANT AND SECTOR - ";A3,A4
5220 IF(A3<>INT(A3))OR(A4<>INT(A4))THEN5990
5221 IFA3<0THEN5040
5222 IFA3=0THENA3=10*Q1+Q2
5223 A3=A3+.5
5225 K=INT(A3/10)
5226 IF(K<1)OR(K>8)THEN5990
5227 C6(1)=K:K=INT(A3-C6(1)*10)
5228 IF(K<1)OR(K>8)THEN5990
5229 C6(2)=K:A4=A4+.5
5230 K=INT(A4/100)
5231 IF(K<1)OR(K>10)THEN5990
5232 C6(1)=C6(1)+(K-1)/10:K=INT(A4-K*100)
5233 IF(K<1)OR(K>10)THEN5990
5234 C6(2)=C6(2)+(K-1)/10
5235 X=Q1+((S6-1)/10)-C6(1):Y=Q2+((S7-1)/10)-C6(2)
5236 D1=0:D2=0:IF(X=0)AND(Y=0)THEN5250
5237 D1=SQR(X*X+Y*Y)
5238 IFX<0THENZ7=SGN(Y)*(3.1416-ATN(ABS(Y/X)))
5239 IFX=0THENZ7=SGN(Y)*1.5708
5240 IFX>0THENZ7=ATN(Y/X)
5245 D2=12-Z7*1.9098593:IFD2>12THEND2=D2-12
5250 ?"COURSE IS";FNS(D2);" FOR A DISTANCE OF";
5260 ?FNS(D1);"QUADRANTS.":GOTO5040
5302 INPUT"ENTER DISTANCE AND WARP FACTOR";D1,A4
5304 IF(D1<0)THEN5040
5310 C7=D1*A4*A4*A4
5315 T1=(10*D1)/((A4*A4)+1E-05)
5320 ?"IT WOULD TAKE";FNS(T1);"STARDATES AND USE"
5325 ?FNR(C7);"UNITS OF ENERGY (";FNR(C7+C7);"IF SHIELDS ARE UP)"
5330 GOTO5040
5410 INPUT"ENTER DISTANCE...";D1
5420 IFD1<0THEN5040
5430 C7=250*D1+50:T1=D1/.4
5440 ?"IT WOULD TAKE";FNR(T1);"STARDATES AND USE"
5450 ?C7;"UNITS OF ENERGY"
5460 GOTO5040
5510 INPUT"ENTER PHASER RANGE IN QUADRANTS";A3
5520 IFA3<0THEN5040
5530 A3=A3*10:C7=(.9^A3)*100
5540 ?"PHASERS ARE ";LEFT$(STR$(C7),5);"% EFFECTIVE AT THAT RANGE"
5550 GOTO5040
5610 GOSUB23000
5620 GOTO5040
5700 RETURN
5990 ?"FORMAT IS MN,XXYY...WHERE MN IS THE QUADRANT"
5991 ?"AND XXYY IS THE SECTOR...E.G. 64,0307 REFERS"
5992 ?"TO QUADRANT 6-4, SECTOR 3-7."
5995 GOTO 5040
6000 IFT2$<>"C"THEN6100
6010 C3=0:?"*** COMMANDER AT";
6030 FORF=1TOR2:IF(C1(F)=Q1)AND(C2(F)=Q2)THEN6050
6040 NEXTF
6050 C1(F)=C1(R2):C2(F)=C2(R2):C1(R2)=0:C2(R2)=0
6060 R2=R2-1:F1(2)=1E+30
6070 IFR2<>0THENF1(2)=D0-(I4/R2)*LOG(RND(1))
6080 K2=K2+1
6090 GOTO6120
6100 ?"*** KLINGON AT";
6110 K1=K1+1
6120 ?A5;"-";A6;"DESTROYED."
6130 Q$(A5,A6)=".":R1=R1-1
6140 IFR1=0THENRETURN
6150 R5=R4/(R1+4*R2)
6160 G(Q1,Q2)=G(Q1,Q2)-100
6170 FORF=1TOK3
6180 IF(K4(F)=A5)AND(K5(F)=A6)THEN6200
6190 NEXTF
6200 K3=K3-1
6210 IFF>K3THEN6250
6220 FORG=FTOK3
6230 K4(G)=K4(G+1):K5(G)=K5(G+1):K6(G)=K6(G+1)
6235 K7(G)=K7(G+1):K8(G)=K7(G)
6240 NEXTG
6250 K4(K3+1)=0:K5(K3+1)=0:K7(K3+1)=0:K8(K3+1)=0:K6(K3+1)=0
6260 RETURN
7000 IFC5$="DOCKED"THEN7100
7010 IFB6=0THEN7020
7015 IF(ABS(S6-B6)<=1)AND(ABS(S7-B7)<=1)THEN7040
7020 ?S5$;" NOT ADJACENT TO A BASE."
7030 RETURN
7040 C5$="DOCKED"
7050 ?"---> DOCKING COMPLETED"
7060 E1=I7:S3=I8:T4=I9:L1=J1
7070 RETURN
7100 ?"CAPTAIN, WE'RE ALREADY DOCKED!"
7110 RETURN
8001 J=0:?:FORI=1TO12
8010 IFD4(I)<=0THEN8070
8020 IFJ<>0THEN8060
8030 ?" DEVICE";SPC(12);"-REPAIR TIMES-"
8040 ?SPC(21);"IN FLIGHT DOCKED":J=1
8060 ?" ";D$(I);TAB(23);FNS(D4(I));TAB(33);FNS(D3*D4(I))
8070 NEXTI
8080 IFJ=0THEN?" - ALL DEVICES FUNCTIONAL -"
8090 RETURN
9000 M=0:D7=D0+T1:FORL=1TO5
9020 IFF1(L)>D7THEN9040
9030 M=L:D7=F1(L)
9040 NEXTL
9050 X6=D7-D0:D0=D7
9060 R4=R4-(R1+4*R2)*X6
9070 R5=R4/(R1+4*R2)
9080 IFR5>0THEN9120
9090 F9=2
9100 GOSUB10000
9110 RETURN
9120 IF(D4(5)=0)OR(C5$="DOCKED")THEN9180
9130 IF(L1>=X6)OR(D4(5)<=L1)THEN9160
9140 F9=3:GOSUB10000
9150 RETURN
9160 L1=L1-X6
9170 IFD4(5)<=X6THENL1=J1
9180 R=X6
9190 IFC5$="DOCKED"THENR=X6/D3
9200 FORL=1TO12
9210 IFD4(L)<=0THEN9230
9220 D4(L)=D4(L)-R
9225 IFD4(L)<0THEND4(L)=0
9226 IFD4(L)<>0THEN9230
9227 ?:?"DAMAGE CONTROL- ";D$(L);" NOW OPERATIONAL."
9230 NEXTL
9240 IFM=0THENRETURN
9250 T1=T1-X6
9260 ONMGOTO9280,9291,9340,9355,9475
9280 X2=0:Y2=0:GOSUB27000
9285 F1(1)=D0-.5*I5*LOG(RND(1))
9286 IFG(Q1,Q2)=LQTHENRETURN
9287 GOTO9000
9291 IFR2=0THEN9330
9292 IFC5$="DOCKED"THEN9325
9293 I=INT(RND(1)*R2)+1
9294 Y6=(C1(I)-Q1)^2+(C2(I)-Q2)^2
9295 IFY6=0THEN9325
9296 Y6=SQR(Y6):T1=.17778*Y6
9297 ?:?"*** ";S5$;" CAUGHT IN LONG-RANGE TRACTOR BEAM--"
9298 Q1=C1(I):Q2=C2(I)
9299 S6=FNB(1):S7=FNB(1)
9300 ?"PULLED TO QUADRANT";Q1;"-";Q2;", SECTOR";S6;"-";S7
9301 IFR6<>0THEN?"(IDLE PERIOD CANCELLED)"
9302 R6=0
9303 IFS4<>0THEN9320
9304 IF(D4(8)=0)AND(S3>0)THEN9310
9305 ?"(SHIELDS NOT CURRENTLY USABLE.)"
9307 GOTO9320
9310 GOSUB26500
9315 S9=0
9320 GOSUB18000
9325 F1(2)=D0+T1-1.5*(I5/R2)*LOG(RND(1))
9326 GOTO9000
9330 F1(2)=1E+30:GOTO9000
9340 D9(1)=D0:D9(2)=R1:D9(3)=R2:D9(4)=R3:D9(5)=R4:D9(6)=R5
9342 D9(7)=S1:D9(8)=B1:D9(9)=K1:D9(10)=K2
9343 FORI=1TO8:FORJ=1TO8:D9(I-1+8*(J-1)+11)=G(I,J):NEXTJ:NEXTI
9344 FORI=75TO84:D9(I)=C1(I-74):NEXT
9345 FORI=85TO94:D9(I)=C2(I-84):NEXT
9346 FORI=95TO99:D9(I)=B2(I-94):NEXT
9347 FORI=100TO104:D9(I)=B3(I-99):NEXT
9348 D9(105)=B4:D9(106)=B5
9349 S0=1:F1(3)=D0-.3*I5*LOG(RND(1)):GOTO9000
9355 IF(R2=0)OR(R3=0)THEN9400
9360 FORI=1TOR3:FORJ=1TOR2:IF(B2(I)=C1(J))AND(B3(I)=C2(J))THEN9410
9370 NEXTJ:NEXTI
9380 F1(4)=D0+.5+3*RND(1)
9390 F1(5)=1E+30:GOTO9000
9400 F1(4)=1E+30:F1(5)=1E+30:GOTO9000
9410 B4=B2(I):B5=B3(I)
9420 IF(B4=Q1)AND(B5=Q2)THEN9380
9430 F1(5)=D0+.5+3*RND(1)
9440 F1(4)=F1(5)-.3*I5*LOG(RND(1))
9450 IFD4(9)>0THEN9000
9460 ?:?" CAPTAIN, THE STARBASE IN";B4;"-";B5;"IS UNDER ATTACK-"
9462 ?" AND CAN ONLY RESIST UNTIL STARDATE";FNR(F1(5));"!!!"
9465 IFR6=0THEN9000
9466 INPUT" SHALL WE CANCEL IDLE PERIOD";B$
9468 IFLEFT$(B$,1)="Y"THENR6=0
9469 GOTO9000
9475 F1(5)=1E+30:IF(R2=0)OR(R3=0)THEN9000
9485 K=INT(G(B4,B5)/100):IFG(B4,B5)-K*100<10THEN9000
9490 FORI=1TOR2:IF(C1(I)=B4)AND(C2(I)=B5)THEN9520
9510 NEXT:GOTO9000
9520 IFS2(B4,B5)=-1THENS2(B4,B5)=0
9530 IFS2(B4,B5)>999THENS2(B4,B5)=S2(B4,B5)-10
9540 IF(B4<>Q1)OR(B5<>Q2)THEN9630
9550 FORI=1TOK3:K=K4(I):L=K5(I)
9560 IFQ$(K,L)="C"THEN9570
9565 NEXT
9570 IFK6(I)<25+50*RND(1)THEN9000
9580 Q$(B6,B7)=".":B6=0:B7=0
9590 GOSUB17000
9600 ?:?"CAPTAIN, I BELIEVE THE STARBASE HAS BEEN DESTROYED"
9620 GOTO9680
9630 IF(R3=1)OR(D4(9)>0)THEN9680
9640 ?
9650 ?"--> STARFLEET COMMAND REPORTS THAT STARBASE IN QUADRANT";B4;"-";B5
9660 ?"HAS BEEN DESTROYED BY ENEMY COMMANDER !!"
9680 G(B4,B5)=G(B4,B5)-10
9690 IFR3<=1THEN9730
9700 FORI=1TOR3:IF(B2(I)=B4)AND(B3(I)=B5)THEN9720
9710 NEXT
9720 B2(I)=B2(R3):B3(I)=B3(R3)
9730 R3=R3-1
9740 GOTO9000
10000 ?:?:?:INPUT"CONFLICT RESOLVED - PREPARED FOR RATING ";B$
10001 ?CHR$(26):A2=1:?:?"IT IS STARDATE";FNR(D0):?
10010 ONF9GOTO10025,10135,10165,10190,10200,10205,10225,10240
10015 ONF9-8GOTO10250,10271,10285
10025 ?"YOU HAVE DESTROYED THE KLINGON INVASION FLEET":?
10030 ?" ***THE FEDERATION IS SAVED***":G1=1
10035 IF(A1=0)OR(B1<>0)THEN10110
10040 IFLEFT$(S5$,1)<>"E"THEN10110
10045 IF3*S1+35*N1+C4>=100THEN10110
10050 IFD0-J2<=6THEN10075
10060 R8=.1*S8*(S8+1)+.1
10065 IF(K1+K2)/(D0-J2)<R8THEN10110
10075 ?:?"YOU HAVE DONE SO WELL THAT COMMAND"
10076 IFS8=4THEN10090
10080 ?"PROMOTES YOU.....";
10085 IFS8=1THEN?"TO NOVICE CLASS!"
10086 IFS8=2THEN?"TO SENIOR CLASS!"
10087 IFS8=3THEN?"TO EXPERT CLASS!"
10088 ?" ***CONGRATULATIONS***":GOTO10110
10090 ?"PROMOTES YOU TO 'COMMODORE EMERITUS'."
10100 ?:?"NOW YOU CAN RETIRE !"
10110 GOSUB23000
10120 RETURN
10135 ?"TIME HAS RUN OUT - THE FEDERATION HAS BEEN CONQUERED AND YOUR CRAFT"
10136 ?"IS NOW ENEMY PROPERTY... YOU WILL STAND TRIAL AS A WAR-CRIMINAL..."
10137 ?"ON THE BASIS OF YOUR RECORD YOU WILL BE";
10139 IFR1*3>I1THEN10150
10140 ?" SUMMARILY EXECUTED"
10145 A1=0:GOSUB23000:RETURN
10150 ?" IMPRISONED FOR LIFE"
10165 ?"YOUR LIFE SUPPORT RESERVES HAVE RUN OUT, AND"
10170 ?"YOU WILL SOON DIE!!!"
10172 ?
10175 ?"YOUR STARSHIP IS A DERELICT IN SPACE."
10180 GOTO10300
10190 ?"YOUR ENERGY SUPPLY IS EXHAUSTED.":GOTO10172
10200 ?"THE ";S5$;" HAS BEEN DESTROYED IN BATTLE."
10201 GOTO10300
10205 RETURN
10225 ?"YOUR STARSHIP HAS BEEN DESTROYED BY A NOVA."
10230 ?"NICE WORK, IDIOT !!!":GOTO10300
10240 ?"THE ";S5$;" HAS BEEN INCINERATED BY A SUPERNOVA."
10241 GOTO10300
10250 ?"YOU HAVE BEEN CAPTURED BY THE ENEMY. IF YOU STILL HAD A STARBASE,"
10255 ?"YOU WOULD HAVE BEEN REPATRIATED. SINCE YOU HAVE NO BASES, YOU WILL"
10260 ?"BE MERCILESSLY TORTURED !!"
10266 GOTO10300
10271 ?:?"THE ";S5$;" IS NOW AN EXPANDING CLOUD"
10272 ?"OF SUB-ATOMIC PARTICLES...":GOTO10300
10285 ?"STARBASE WAS UNABLE TO RE-MATERIALIZE YOUR STARSHIP."
10300 ?
10310 IFLEFT$(S5$,1)="F"THENS5$=""
10315 IFLEFT$(S5$,1)="E"THENS5$="FAERIE QUEENE"
10316 A1=0
10320 IFR1=0THEN10355
10325 G3=R4/I3:B8=(R1+2*R2)/(I1+2*I4)
10326 A3=G3/B8
10327 IF A3<1+.5+RND(1)THEN10345
10330 ?"AS A RESULT OF YOUR ACTIONS, A TREATY WITH THE KLINGON"
10331 ?"EMPIRE HAS BEEN SIGNED. THE TERMS OF THE TREATY ARE"
10332 IFA3<3*RND(1)THEN10340
10335 ?"FAVORABLE TO THE FEDERATION.":?
10336 ?"CONGRATULATIONS.":GOTO10350
10340 ?"HIGHLY UNFAVORABLE TO THE FEDERATION.":GOTO10350
10345 ?"THE FEDERATION WILL BE DESTROYED!"
10350 GOSUB23000:RETURN
10355 ?"SINCE YOU TOOK THE LAST KLINGON WITH YOU, YOU ARE"
10360 ?"A MARTYR AND A HERO.":G1=1:A1=0
10390 GOSUB23000:RETURN
11001 IFC5$<>"DOCKED"THEN11020
11010 ?"--> CAPTAIN, WE'RE ALREADY DOCKED!"
11015 RETURN
11020 IFD4(9)=0THEN11030
11025 ?"SUBSPACE RADIO DAMAGED...CANNOT TRANSMIT.":RETURN
11030 IFR3<>0THEN11050
11040 ?"CAPTAIN, NO RESPONSE FROM STARBASE !":RETURN
11050 N1=N1+1:IFB6=0THEN11070
11060 GOTO11130
11070 D1=1E+30
11080 FORL=1TOR3:X=10*SQR((B2(L)-Q1)^2+(B3(L)-Q2)^2)
11090 IFX>D1THEN11110
11100 D1=X:K=L
11110 NEXTL
11120 Q1=B2(K):Q2=B3(K):GOSUB18000
11130 Q$(S6,S7)="."
11135 ?
11140 ?"STARBASE IN QUADRANT";Q1;"-";Q2;"RESPONDS --";
11145 ?" ";S5$;" DEMATERIALIZES."
11146 P2=(1-.98^D1)^.333333
11150 FORL=1TO3
11155 IFL=1THEN?"1ST ";
11160 IFL=2THEN?"2ND ";
11170 IFL=3THEN?"3RD ";
11180 ?"ATTEMPT TO RE-MATERIALIZE THE ";S5$;". . . . .";
11190 IFRND(1)>P2THEN11220
11200 ?"FAILS.":NEXTL
11210 F9=11:GOSUB10000:RETURN
11220 FORL=1TO5:I=B6+INT(3*RND(1))-1
11230 IF(I<1)OR(I>10)THEN11260
11235 J=B7+INT(3*RND(1))-1
11240 IF(J<1)OR(J>10)THEN11260
11250 IFQ$(I,J)="."THEN11270
11260 NEXTL:?"FAILS.":GOTO11210
11270 ?"SUCCEEDS.":S6=I:S7=J:Q$(I,J)=LEFT$(S5$,1)
11280 GOSUB7000:?"CAPTAIN, WE MADE IT!":RETURN
12001 P4=2:L5=K3:N=1
12010 FORK=1TOL5
12020 IFH3(K)=0THEN12240
12030 D6=.9+.01*RND(1):H2=H3(K)*D6^K7(N)
12040 P3=K6(N)
12050 P=ABS(P3):IFP4*H2<PTHENP=P4*H2
12060 K6(N)=P3-SGN(P3)*ABS(P)
12070 X8=K4(N):Y8=K5(N)
12080 IFH2>4.99THEN12100
12090 ?"MINOR HIT ON ":GOTO12110
12100 ?FNR(H2);"UNIT HIT ON ";
12110 M$=Q$(X8,Y8)
12120 IF M$="K"THEN?"KLINGON AT";
12125 IFM$="C"THEN?"COMMANDER AT";
12130 ?X8;"-";Y8
12140 IFK6(N)<>0THEN12180
12150 A5=X8:A6=Y8:T2$=Q$(X8,Y8):GOSUB6000
12160 IFR1<>0THEN12250
12170 F9=1:GOSUB10000:GOTO12250
12180 IFK6(N)<0THEN12240
12190 IFRND(1)<.9THEN12240
12200 IFK6(N)>(.4+.4*RND(1))*P3THEN12240
12205 ?
12210 ?"*** CAPTAIN, THE VESSEL AT SECTOR";
12215 ?X8;"-";Y8
12220 ?" HAS JUST LOST ITS FIREPOWER !!!"
12225 ?
12230 K6(N)=-K6(N)
12240 N=N+1
12250 NEXTK
12260 RETURN
13001 J3=0
13010 IFD4(7)<>0THEN13250
13020 IFE1<=75THEN13070
13030 INPUT"ENTER COURSE....";D2
13040 IFD2<.01ORD2>12THENGOSUB40000ELSE13048
13041 RETURN
13048 INPUT"DISTANCE ";D1:IFD1>0THEN13050
13049 RETURN
13050 P3=50+250*D1
13060 IFP3<E1THEN13140
13070 ?
13080 ?"1ST OFFICER SPOCK- 'CAPTAIN, THE IMPULSE ENGINES"
13090 ?"REQUIRE 50 UNITS OF ENERGY TO ENGAGE, PLUS 250 UNITS PER ";
13100 IFE1>75THEN13120
13110 ?"QUADRANT. THEY ARE USELESS NOW.'":RETURN
13120 ?"QUADRANT. WE CAN GO A MAXIMUM OF ";
13130 ?FNR(4E-03*(E1-50)-.05);"QUADRANTS.'":RETURN
13140 T1=D1/.4
13150 IFT1<R5THEN13200
13160 ?"SIR, MAX. SPEED UNDER IMPULSE IS ONLY 4 SECTORS PER STARDATE"
13170 INPUT"-- AUTHORIZE ";B$
13190 IFLEFT$(B$,1)<>"Y"THENRETURN
13200 GOSUB15001:J3=1
13210 IFA2<>0THENRETURN
13220 E1=E1-P3
13230 IFE1>0THENRETURN
13240 F9=4:GOSUB10000:RETURN
13250 ?"IMPULSE ENGINES DAMAGED.":RETURN
14001 N$=" #"
14005 ?
14010 IFD4(2)<>0THEN14180
14020 ?"L.R. SCAN FOR QUADRANT";Q1;"-";Q2:?
14030 I=Q1-1:J=Q1+1:K=Q2-1:L=Q2+1
14040 FORM=ITOJ:FORN=KTOL
14050 IF(M<=0)OR(M>8)THEN14110
14060 IF(N<=0)OR(N>8)THEN14110
14070 IFD4(11)=0THENS2(M,N)=1
14080 IFG(M,N)>=LQTHEN ?" ***";" ";
14090 IFG(M,N)<LQTHEN?SPC(5-LEN(STR$(G(M,N))));G(M,N);
14100 GOTO14120
14110 ?N$;" ";
14120 NEXTN:?
14130 ?
14140 NEXTM
14150 IFD4(11)=0THENRETURN
14160 ?"*** WARNING *** - COMPUTER DISABLED - SCAN NOT RECORDED."
14170 RETURN
14180 ?"LONG RANGE SENSORS DAMAGED.":RETURN
15001 A5=(15-D2)*.523599:D4=-SIN(A5):D6=COS(A5):B8=ABS(D4)
15030 IFABS(D6)>B8THENB8=ABS(D6)
15040 D4=D4/B8:D6=D6/B8:T5=0:T6=0
15050 IFD0+T1<F1(2)THEN15080
15060 T5=1:C5$="RED":D1=D1*(F1(2)-D0)/T1+.1
15070 T1=F1(2)-D0+1E-05
15080 Q$(S6,S7)=".":X7=S6:Y7=S7:H9=INT(10*D1*B8+.5)
15090 IFH9=0THEN15115
15100 FORL=1TOH9
15102 X7=X7+D4:X1=INT(X7+.5):Y7=Y7+D6:Y1=INT(Y7+.5)
15105 IF(X1<1)OR(X1>10)THEN15150
15106 IF(Y1<1)OR(Y1>10)THEN15150
15108 IFQ$(X1,Y1)="O"THEN15111
15109 IFQ$(X1,Y1)<>"."THEN15125
15110 NEXTL
15111 D1=.1*SQR((S6-X1)^2+(S7-Y1)^2)
15112 S6=X1:S7=Y1
15115 F4=S6:F5=S7
15116 IFQ$(X1,Y1)<>"O"THEN15320
15120 T2=FNA(1):T3=FNA(1)
15122 Q1=FNA(1):Q2=FNA(1):S6=FNB(1):S7=FNB(1):?
15123 ?"*** SPACE PORTAL ENTERED ***":GOTO15307
15125 T6=1:K=50*D1/T1+.001:D1=.1*SQR((S6-X1)^2+(S7-Y1)^2)
15127 IF(Q$(X1,Y1)="K")OR(Q$(X1,Y1)="C")THEN15145
15129 ?:?S5$;" BLOCKED BY ";
15130 IFQ$(X1,Y1)="*"THEN?"STAR AT";
15131 IFQ$(X1,Y1)="B"THEN?"STARBASE AT";
15132 ?" SECTOR";X1;"-";Y1;"...."
15133 ?"EMERGENCY STOP REQUIRED";FNR(K);"UNITS OF ENERGY."
15135 E1=E1-K
15137 S6=INT(X7-D4+.5):F4=S6:S7=INT(Y7-D6+.5):F5=S7
15140 IFE1>0THEN15320
15141 F9=4:GOSUB10000:RETURN
15145 S6=X1:S7=Y1:GOSUB22001:F4=S6:F5=S7:GOTO15320
15150 IFK3=0THEN15165
15155 FORL=1TOK3
15156 F3=SQR((X1-K4(L))^2+(Y1-K5(L))^2)
15158 K8(L)=.5*(F3+K7(L)):NEXTL
15160 IFG(Q1,Q2)<>LQTHENGOSUB1000
15162 IFA2<>0THENRETURN
15165 X7=10*(Q1-1)+S6:Y7=10*(Q2-1)+S7
15170 X1=INT(X7+10*D1*B8*D4+.5)
15175 Y1=INT(Y7+10*D1*B8*D6+.5):L6=0
15180 L5=0
15185 IFX1>0THEN15195
15190 X1=-X1+1:L5=1
15195 IFY1>0THEN15210
15200 Y1=-Y1+1:L5=1
15210 IFX1<=80THEN15220
15215 X1=161-X1:L5=1
15220 IFY1<=80THEN15230
15225 Y1=161-Y1:L5=1
15230 IFL5=0THEN15240
15235 L6=1:GOTO15180
15240 IFL6=0THEN15270
15260 ?:?"*** MESSAGE FROM STARFLEET COMMAND.....STARDATE";FNR(DO)
15261 ?"PERMISSION TO EXIT GALAXY - DENIED -"
15265 ?"'ENGINES SHUT DOWN AT ";
15266 Z1=INT((X1+9)/10):Z2=INT((Y1+9)/10)
15267 ?"QUADRANT";Z1;"-";Z2;", ";
15268 ?"SECTOR";X1-10*(Z1-1);"-";Y1-10*(Z2-1);"'"
15270 IFT5<>0THENRETURN
15295 Q1=INT((X1+9)/10):Q2=INT((Y1+9)/10)
15296 S6=X1-10*(Q1-1):S7=Y1-10*(Q2-1)
15307 GOSUB18400:?:GOTO15315
15310 ?CHR$(26):?"ENTERING THE ";G2$;" QUADRANT (";Q1;"-";Q2;")"
15315 Q$(S6,S7)=LEFT$(S5$,1):GOSUB18000:GOSUB29002:GOSUB14001:RETURN
15320 Q$(S6,S7)=LEFT$(S5$,1)
15321 IFL6=1THENRETURN
15325 IFK3=0THEN15390
15330 FORL=1TOK3
15340 F3=SQR((F4-K4(L))^2+(F5-K5(L))^2)
15350 K8(L)=.5*(K7(L)+F3)
15360 K7(L)=F3
15370 NEXTL
15380 GOSUB28000
15390 GOSUB17000:RETURN
16001 A=1:B=1
16010 FORK=1TOK3
16020 C=K4(K):D=K5(K)
16030 IFQ$(C,D)="C"THEN16050
16040 NEXTK
16050 N=0:F=K6(K)+100*K3
16060 IFF>LQTHENN=INT(RND(1)*K7(K)+1)
16065 IF((C5$="DOCKED")AND((B4<>Q1)OR(B5<>Q2)))THENN=-S8
16070 IFN=0THENN=INT(((F+200*RND(1))/150)-5)
16071 IFN=0THENRETURN
16072 IF(N>0)AND(K7(K)<1.5)THENRETURN
16075 IFABS(N)>S8THENN=SGN(N)*ABS(S8)
16080 T=ABS(N):P=S6-C:Q=S7-D
16085 IF2*ABS(P)<ABS(Q)THENP=0
16090 IF2*ABS(Q)<ABS(P)THENQ=0
16095 IFP<>0THENP=SGN(P*N)
16100 IFQ<>0THENQ=SGN(Q*N)
16105 R=C:S=D:Q$(C,D)="."
16110 FORL2=1TOT:L=R+P:M=S+Q
16115 IF(L>0)AND(L<=10)THEN16120
16117 ONSGN(N)+2GOTO16240,16165,16165
16120 IF(M>0)AND(M<=10)THEN16130
16125 ONSGN(N)+2GOTO16240,16135,16135
16130 IFQ$(L,M)="."THEN16195
16135 IF(Q=B)OR(P=0)THEN16165
16140 M=S+B
16145 IF(M>0)AND(M<=10)THEN16155
16150 ONSGN(N)+2GOTO16240,16160,16160
16155 IFQ$(L,M)="."THEN16195
16160 B=-B
16165 IF(P=A)OR(Q=0)THEN16200
16170 L=R+A
16175 IF(L>0)AND(L<=10)THEN16185
16180 ONSGN(N)+2GOTO16240,16190,16190
16185 IFQ$(L,M)="."THEN16195
16190 A=-A:GOTO16200
16195 R=L:S=M
16200 NEXTL2
16205 Q$(R,S)="C"
16210 IF(R=C)AND(S=D)THENRETURN
16215 K4(K)=R:K5(K)=S:K7(K)=SQR((S6-R)^2+(S7-S)^2)
16220 K8(K)=K7(K):IFN>0THEN?"*** COMMANDER ADVANCES TO";
16225 IFN<0THEN?"*** COMMANDER RETREATS TO";
16230 ?" SECTOR";R;"-";S:GOSUB28000:RETURN
16240 I=Q1+INT((L+9)/10)-1:J=Q2+INT((M+9)/10)-1
16245 IF(I<1)OR(I>8)THEN16350
16250 IF(J<1)OR(J>8)THEN16350
16260 FORL3=1TOR2
16265 IF(C1(L3)=I)AND(C2(L3)=J)THEN16350
16270 NEXTL3:?"*** COMMANDER ESCAPES TO ";
16275 ?"QUADRANT";I;"-";J;" (AND REGAINS STRENGTH)"
16280 K4(K)=K4(K3):K5(K)=K5(K3):K7(K)=K7(K3):K8(K)=K8(K3)
16285 K6(K)=K6(K3):K3=K3-1:C3=0
16290 IFC5$<>"DOCKED"THENGOSUB17000
16300 GOSUB28000
16310 G(Q1,Q2)=G(Q1,Q2)-100:G(I,J)=G(I,J)+100
16320 FORL3=1TOR2
16330 IF(C1(L3)=Q1)AND(C2(L3)=Q2)THEN16340
16335 NEXTL3
16340 C1(L3)=I:C2(L3)=J:RETURN
16350 A=-A:B=-B:GOTO16200
17000 C5$="GREEN":IFE1<LQTHENC5$="YELLOW"
17020 IFG(Q1,Q2)>99THENC5$="RED"
17030 RETURN
18000 J4=1:B6=0:B7=0:K3=0:C3=0:U=G(Q1,Q2):IFU>999THEN18290
18030 K3=INT(.01*U):FORA=1TO10:FORB=1TO10:Q$(A,B)=".":NEXTB:NEXTA
18040 Q$(S6,S7)=LEFT$(S5$,1):U=G(Q1,Q2):IFU<100THEN18150
18050 U=U-100*K3:FORA=1TOK3
18060 S=FNB(1):K4(A)=S:T=FNB(1):K5(A)=T
18070 IFQ$(S,T)<>"."THEN18060
18080 Q$(S,T)="K":K7(A)=SQR((S6-S)^2+(S7-T)^2):K8(A)=K7(A)
18090 K6(A)=RND(1)*150+325:NEXTA
18100 IFR2=0THEN18140
18110 FORA=1TOR2
18115 IF(C1(A)=Q1)AND(C2(A)=Q2)THEN18130
18120 NEXTA:GOTO18140
18130 Q$(S,T)="C":K6(K3)=LQ+400*RND(1):C3=1
18140 GOSUB28000
18150 IFU<10THEN18190
18160 U=U-10
18170 B6=FNB(1):B7=FNB(1):IFQ$(B6,B7)<>"."THEN18170
18180 Q$(B6,B7)="B"
18190 GOSUB17000:IFU<1THENRETURN
18200 FORA=1TOU
18210 S=FNB(1):T=FNB(1):IFQ$(S,T)<>"."THEN18210
18220 Q$(S,T)="*":NEXTA
18230 IF(T2<>Q1)OR(T3<>Q2)THENRETURN
18240 S=FNB(1):T=FNB(1):IFQ$(S,T)<>"."THEN18240
18250 Q$(S,T)="O":?
18260 ?"*** SHORT-RANGE SENSORS DETECT A SPACE-WARP IN THIS QUADRANT"
18280 RETURN
18290 FORA=1TO10:FORB=1TO10:Q$(A,B)=".":NEXTB:NEXTA
18300 Q$(S6,S7)=LEFT$(S5$,1):RETURN
18400 G4$="III":L=2:IFQ2>=5THEN18420
18410 L=1
18420 G2$=G1$(2*(Q1-1)+L):L=Q2
18425 IFL<=4THEN18440
18430 L=Q2-4
18440 G3$="IV":IFL=4THEN18460
18450 G3$=LEFT$(G4$,L)
18460 G2$=G2$+" "+G3$:RETURN
19002 IFRND(1)>.1THEN19015
19010 GOSUB27000:RETURN
19015 Q$(A5,A6)=".":?"*** STAR AT SECTOR";A5;"-";A6;"NOVAS."
19020 G(Q1,Q2)=G(Q1,Q2)-1:S1=S1+1
19025 B9=1:T6=1:T7=1:K=0:X1=0:Y1=0
19030 H4(B9,1)=A5:H4(B9,2)=A6
19035 FORM=B9TOT6:FORQ=1TO3:FORJ=1TO3
19040 IFJ*Q=4THEN19260
19045 J5=H4(M,1)+Q-2:J6=H4(M,2)+J-2
19050 IF(J5<1)OR(J5>10)THEN19260
19055 IF(J6<1)OR(J6>10)THEN19260
19060 IFQ$(J5,J6)="."THEN19260
19065 IFQ$(J5,J6)="O"THEN19260
19070 IFQ$(J5,J6)<>"*"THEN19105
19075 IFRND(1)>=.1THEN19085
19080 X2=J5:Y2=J6:GOSUB27000:RETURN
19085 T7=T7+1:H4(T7,1)=J5:H4(T7,2)=J6:G(Q1,Q2)=G(Q1,Q2)-1
19090 S1=S1+1:?"*** STAR AT SECTOR";J5;"-";J6;"NOVAS."
19100 GOTO19255
19105 IFQ$(J5,J6)<>"B"THEN19140
19110 G(Q1,Q2)=G(Q1,Q2)-10:FORV=1TOR3
19115 IF(B2(V)<>Q1)OR(B3(V)<>Q2)THEN19125
19120 B2(V)=B2(R3):B3(V)=B3(R3)
19125 NEXTV:R3=R3-1:B6=0:B7=0:B1=B1+1:GOSUB17000
19130 ?"*** STARBASE AT SECTOR";J5;"-";J6;"DESTROYED."
19135 GOTO19255
19140 IF(S6<>J5)OR(S7<>J6)THEN19190
19145 ?"*** STARSHIP BUFFETED BY NOVA.":IFS4<>0THEN19155
19150 E1=E1-LQ:GOTO19170
19155 IFS3>=LQTHEN19180
19160 D6=LQ-S3:E1=E1-D6:GOSUB17000:S3=0:S4=0
19165 ?"*** STARSHIP SHIELDS KNOCKED OUT.":D4(8)=5E-03*D5*RND(1))*D6
19170 IFE1>0THEN19185
19175 F9=7:GOSUB10000:RETURN
19180 S3=S3-LQ
19185 X1=X1+S6-H4(M,1):Y1=Y1+S7-H4(M,2):K=K+1:GOTO19260
19190 IFQ$(J5,J6)<>"C"THEN19250
19195 FORV=1TOK3
19200 IF(K4(V)=J5)AND(K5(V)=J6)THEN19210
19205 NEXTV
19210 K6(V)=K6(V)-800:IFK6(V)<=0THEN19250
19215 N5=J5+J5-H4(M,1):N6=J6+J6-H4(M,2)
19220 ?"*** COMMANDER AT SECTOR";J5;"-";J6;"DAMAGED";
19225 IF(N5<1)OR(N5>10)OR(N6<1)OR(N6>10)THEN19245
19230 ?" AND BUFFETED TO SECTOR";N5;"-";N6
19235 Q$(N5,N6)="C":K4(V)=N5:K5(V)=N6
19240 K7(V)=SQR((S6-N5)^2+(S7-N6)^2):K8(V)=K7(V)
19241 Q$(J5,J6)="."
19245 ?:GOTO19260
19250 A5=J5:A6=J6:T2$=Q$(J5,J6):GOSUB6000:GOTO19260
19255 ?:Q$(J5,J6)="."
19260 NEXTJ:NEXTQ:NEXTM
19265 IFT6=T7THEN19280
19270 B9=T6+1:T6=T7:GOTO19035
19280 IFK=0THENRETURN
19290 D1=K*.1
19300 IFX1<>0THENX1=SGN(X1)
19310 IFY1<>0THENY1=SGN(Y1)
19320 I=3*(X1+1)+Y1+2
19330 D2=C5(I)
19340 IFD2=0THEND1=0
19350 IFD1=0THENRETURN
19360 ?:?"FORCE OF NOVA DISPLACES STARSHIP."
19370 GOSUB15001:RETURN
20001 P=2:J3=1
20020 IFC5$<>"DOCKED"THEN20030
20025 ?"PHASERS CAN'T BE FIRED THRU BASE SHIELDS.":GOTO20080
20030 IFD4(3)=0THEN20050
20040 ?"PHASER BANKS DAMAGED.":GOTO20080
20050 IFS4=0THEN20060
20055 ?"SHIELDS MUST BE DOWN TO FIRE PHASERS.":GOTO20080
20060 IFK3>0THEN20090
20065 ?
20070 ?"THE SHORT-RANGE SENSORS DETECT NO ENEMY IN THIS QUADRANT."
20080 J3=0:RETURN
20090 ?"PHASERS LOCKED ON TARGET. ENERGY AVAILABLE=";
20095 ?.01*INT(100*E1)
20100 INPUT"UNITS TO FIRE";P1:IFP1<E1THEN20120
20110 ?"ENERGY AVAILABLE =";:GOTO20095
20120 IFP1>0THEN20140
20130 J3=0:RETURN
20140 E1=E1-P1
20142 IFD4(11)=0THEN20147
20144 P1=P1*(RND(1)*.5+.5)
20145 ?:?"COMPUTER MALFUNCTION HAMPERS PHASER ACCURACY.":?
20147 E=P1:IFK3=0THEN20310
20150 E=0:T5=(K3*(K3+1))/2
20160 FORI=1TOK3:H3(I)=((K3+1-I)/T5)*P1
20170 H5(I)=ABS(K6(I))/(P*.9^K7(I))
20180 IFH3(I)<=H5(I)THEN20200
20190 E=E+(H3(I)-H5(I)):H3(I)=H5(I)
20200 NEXTI
20210 IFE=0THEN20280
20220 FORI=1TOK3:R7=H5(I)-H3(I)
20230 IFR7<=0THEN20260
20240 IFR7>=ETHEN20270
20250 H3(I)=H5(I):E=E-R7
20260 NEXTI:GOTO20280
20270 H3(I)=H3(I)+E:E=0
20280 GOSUB12001
20290 IF(E<>0)AND(A2=0)THEN20310
20300 J3=1:RETURN
20310 ?FNR(E);"EXPENDED ON EMPTY SPACE.":J3=1:RETURN
21001 J3=1:IFD4(4)=0THEN21015
21010 ?"PHOTON TUBES DAMAGED.":GOTO21035
21015 IFT4<>0THEN21025
21020 ?"NO TORPEDOS LEFT.":GOTO21035
21025 INPUT"TORPEDO COURSE";C6
21030 IFC6<.01ORC6>12THENGOSUB40000ELSE21040
21035 J3=0:RETURN
21040 INPUT"BURST OF 3";B$:N=1
21045 IFLEFT$(B$,1)="N"THEN21070
21050 IFLEFT$(B$,1)<>"Y"THEN21040
21051 IFT4>2THEN21060
21055 ?"NO BURST. ONLY";T4;"TORPEDOS LEFT.":GOTO21035
21060 INPUT"SPREAD ANGLE (3 - 30 DEG)";G2
21061 IFG2<0THEN21035
21062 IF(G2<3)OR(G2>30)THEN21060
21063 G2=FND(G2)
21065 N=3
21070 FORZ6=1TON
21075 IFC5$<>"DOCKED"THENT4=T4-1
21080 Z7=Z6:R=RND(1)
21085 R=(R+RND(1))*.5-.5
21090 IF(R>=-.4)AND(R<=.4)THEN21125
21095 R=(RND(1)+1.2)*R:IFN=3THEN21105
21100 ?"*** METEORITE DEFLECTION":R=INT(RND(1)*50)+1
21101 ?"TORPEDO EFFECTIVENESS REDUCED"; R;"%":?:GOTO21110
21105 ?"*** TORPEDO NUMBER";Z6;"MISFIRE - ";R;"% DOWN"
21110 IF RND(1)>.2THEN21125
21115 ?"*** PHOTON TUBES DAMAGED BY MISFIRE."
21120 D4(4)=D5*(1+2*RND(1)):GOTO21440
21125 IF(S4<>0)OR(C5$="DOCKED")THENR=R+1E-03*S3*R
21130 A3=C6+.25*R:IFN=1THEN21140
21135 A8=(15-A3+(2-Z6)*G2)*.523599:?
21137 ?"TRACK FOR TORPEDO NUMBER";Z7;"--":GOTO21145
21140 ?:?"TORPEDO TRACK --":A8=(15-A3)*.523599
21145 X4=-SIN(A8):Y4=COS(A8):B8=ABS(X4)
21146 IFABS(Y4)>ABS(X4)THENB8=ABS(Y4)
21150 X4=X4/B8:Y4=Y4/B8:X5=S6:Y5=S7
21155 FORL9=1TO15:X5=X5+X4:A5=INT(X5+.5)
21160 IF(A5<1)OR(A5>10)THEN21430
21165 Y5=Y5+Y4:A6=INT(Y5+.5)
21170 IF(A6<1)OR(A6>10)THEN21430
21175 IF(L9=5)OR(L9=9)THEN?
21180 ?FNR(X5);"-";FNR(Y5);", ";
21185 IFQ$(A5,A6)<>"."THEN21195
21190 GOTO21425
21195 ?:IFQ$(A5,A6)="K"THEN21220
21200 IFQ$(A5,A6)<>"C"THEN21325
21205 IFRND(1)>.1THEN21220
21210 ?"*** COMMANDER AT SECTOR";A5;"-";A6;"USES ANTI-PHOTON DEVICE !"
21215 ?"-- TORPEDO NEUTRALIZED.":GOTO21435
21220 FORV=1TOK3
21225 IF(A5=K4(V))AND(A6=K5(V))THEN21235
21230 NEXTV
21235 K=K6(V):W3=200+800*RND(1)
21240 IFABS(K)<W3THENW3=ABS(K)
21245 K6(V)=K-SGN(K)*ABS(W3):IFK6(V)<>0THEN21255
21250 T2$=Q$(A5,A6):GOSUB6000:GOTO21435
21255 IFQ$(A5,A6)="K"THEN?"*** KLINGON AT";
21260 IFQ$(A5,A6)="C"THEN?"*** COMMANDER AT";
21265 ?A5;"-";A6;
21270 A7=A8+2.5*(RND(1)-.5)
21275 W3=ABS(-SIN(A7)):IFABS(COS(A7))>W3THENW3=ABS(COS(A7))
21280 X7=-SIN(A7)/W3:Y7=COS(A7)/W3
21285 P=INT(A5+X7+.5):Q=INT(A6+Y7+.5)
21290 IF(P<1)OR(P>10)OR(Q<1)OR(Q>10)THEN21320
21295 IFQ$(P,Q)<>"."THEN21320
21300 Q$(P,Q)=Q$(A5,A6):Q$(A5,A6)=".":?"DAMAGED--"
21305 ?" DISPLACED BY BLAST TO SECTOR";P;"-";Q
21310 K4(V)=P:K5(V)=Q:K7(V)=SQR((S6-P)^2+(S7-Q)^2)
21311 K8(V)=K7(V)
21315 GOSUB28000:GOTO21435
21320 ?"DAMAGED, BUT NOT DESTROYED.":GOTO21435
21325 IFQ$(A5,A6)<>"B"THEN21365
21330 ?"*** STARBASE DESTROYED...!!!"
21335 IFS2(Q1,Q2)<0THENS2(Q1,Q2)=0
21340 FORW=1TOR3
21345 IF(B2(W)<>Q1)OR(B3(W)<>Q2)THEN21355
21350 B2(W)=B2(R3):B3(W)=B3(R3)
21355 NEXTW:Q$(A5,A6)=".":R3=R3-1:B6=0:B7=0
21360 G(Q1,Q2)=G(Q1,Q2)-10:B1=B1+1:GOSUB17000:GOTO21435
21365 IFQ$(A5,A6)<>"*"THEN21405
21370 IFRND(1)>.15THEN21385
21375 ?"*** STAR AT SECTOR";A5;"-";A6;"UNAFFECTED BY PHOTON BLAST"
21380 GOTO21435
21385 X2=A5:Y2=A6:GOSUB19002:A5=X2:A6=Y2
21390 IFG(Q1,Q2)=LQTHENRETURN
21395 IFA2<>0THENRETURN
21400 GOTO21435
21405 ?:?" >>> ORGANIAN TRUCE-MONITOR DESTROYED <<<":Q$(A5,A6)=".":?
21420 T2=0:T3=0:GOTO21435
21425 NEXTL9
21430 ?:?"TORPEDO MISSED!"
21435 NEXTZ6
21440 IFR1<>0THENRETURN
21445 F9=1:GOSUB10000:RETURN
22001 ?:?"*** RED ALERT!! RED ALERT!! ***":?
22010 ?"*** COLLISION IMMINENT!!":?
22020 ?"*** ";S5$;" RAMS ";:W7=1:IFQ$(S6,S7)="C"THENW7=2
22030 IFW7=1THEN?"KLINGON AT ";
22040 IFW7=2THEN?"COMMANDER AT ";
22050 ?"SECTOR";S6;"-";S7:A5=S6:A6=S7:T2$=Q$(S6,S7)
22060 GOSUB6000:?"*** ";S5$;" HEAVILY DAMAGED."
22070 K=INT(5+RND(1)*20):?"***SICKBAY REPORTS";K;"CASUALTIES!"
22080 C4=C4+K:FORL=1TO12:I=RND(1)
22090 J=(3.5*W7*(RND(1)+I)+1)*D5
22100 IFL=6THENJ=J/3
22110 D4(L)=D4(L)+T1+J:NEXTL:D4(6)=D4(6)-3
22120 IFD4(6)<0THEND4(6)=0
22130 S4=0:IFR1<>0THENRETURN
22140 F9=1:GOSUB10000:RETURN
23000 P=D0-J2:IF(P<>0)AND(R1=0)THEN23020
23010 IFP<5THENP=5
23020 N=(K2+K1)/P:K=INT(500*N+.5):L=0
23030 IFG1<>0THENL=100*S8
23035 I=0
23040 IFLEFT$(S5$,1)="E"THENM=0
23045 IFLEFT$(S5$,1)="F"THENM=1
23050 IFLEFT$(S5$,1)=""THENM=2
23060 IFA1=0THENI=200
23070 J=10*K1+50*K2+K+L-I-100*B1-100*M-35*N1-3*S1-C4
23080 ?:IFJ<>0THEN23100
23090 ?"AS YET, YOU HAVE NO SCORE.":RETURN
23100 ?"YOUR SCORE --":?:IFK1=0THEN23120
23110 ?K1;TAB(5);"ORDINARY KLINGON(S) DESTROYED";TAB(36);10*K1*MR
23120 IFK2=0THEN23140
23130 ?K2;TAB(5);"KLINGON COMMANDER(S) DESTROYED";TAB(36);50*K2*MR
23140 IFK=0THEN23160
23150 ?FNR(N);TAB(5);"KLINGONS PER STARDATE, AVERAGE";
23155 ?TAB(36);K*MR
23160 IFS1=0THEN23180
23170 ?S1;TAB(5);"STAR(S) DESTROYED";TAB(36);-3*S1*MR
23180 IFB1=0THEN23200
23190 ?B1;TAB(5);"STARBASES DESTROYED";TAB(36);-100*B1*MR
23200 IFN1=0THEN23220
23210 ?N1;TAB(5);"SOS CALL(S) TO A STARBASE";TAB(36);-35*N1*MR
23220 IFC4=0THEN23240
23230 ?C4;TAB(5);"CASUALTIES INCURRED";TAB(36);-C4*MR
23240 IFM=0THEN23260
23250 ?M;TAB(5);"SHIP(S) LOST OR DESTROYED";TAB(36)-100*M*MR
23260 IFA1<>0THEN23280
23270 ?TAB(5)"PENALTY FOR GETTING KILLED";TAB(36);-200*MR
23280 IFG1=0THEN23300
23290 ?TAB(5);"BONUS FOR WINNING ";S$(S8);" GAME";TAB(36);L*MR
23300 ?TAB(5);"-------------------------------------"
23310 ?TAB(28);"TOTAL";TAB(36);J*MR;"**":RETURN
24001 A2=0:G1=0:GOSUB4001:S5$="ENTERPRISE"
24010 I7=5000:E1=I7:I8=2500:S3=I8:S4=0:S9=S4:J1=4:L1=J1
24020 Q1=FNA(1):Q2=FNA(1):S6=FNB(1):S7=FNB(1):I9=10:T4=I9
24030 W1=5:W2=25:FORI=1TO12:D4(I)=0:NEXT
24040 J2=100*INT(31*RND(1)+20):D0=J2:K1=0:K2=0:N1=0:N2=0:R6=0:C4=0
24050 A1=1:D3=.25:FORI=1TO8:FORJ=1TO8:S2(I,J)=0:NEXTJ:NEXTI
24060 F1(1)=D0-.5*I5*LOG(RND(1)):F1(5)=1E+30
24070 F1(2)=D0-1.5*(I5/R2)*LOG(RND(1)):I6=0
24080 F1(3)=D0-.3*I5*LOG(RND(1)):F1(4)=D0-.3*I5*LOG(RND(1))
24090 FORI=1TO8:FORJ=1TO8:K=INT(RND(1)*9+1):I6=I6+K
24100 G(I,J)=K:NEXTJ:NEXTI:S1=0
24110 FOR I=1TOI2
24120 X=INT(RND(1)*6+2):Y=INT(RND(1)*6+2)
24130 IFG(X,Y)>=10THEN24120
24140 IFI<2THEN24180
24150 K=I-1:FORJ=1TOK:D1=SQR((B2(J)-X)^2+(B3(J)-Y)^2)
24160 IFD1<2THEN24120
24170 NEXTJ
24180 B2(I)=X:B3(I)=Y:S2(X,Y)=-1:G(X,Y)=G(X,Y)+10:NEXTI
24190 B1=0:K=I1-I4:L=INT(.25*S8*(9-L2)+1)
24200 M=INT((1-RND(1)^2)*L):IFM>KTHENM=K
24210 N=100*M
24220 X=FNA(1):Y=FNA(1):IFG(X,Y)+N>999THEN24220
24230 G(X,Y)=G(X,Y)+N:K=K-M:IFK<>0THEN24200
24240 FORI=1TOI4
24250 X=FNA(1):Y=FNA(1):IF(G(X,Y)<99)AND(RND(1)<.75)THEN24250
24260 IFG(X,Y)>899THEN24250
24270 IFI=1THEN24300
24280 M=I-1:FORJ=1TOM:IF(C1(J)=X)AND(C2(J)=Y)THEN24250
24290 NEXTJ
24300 G(X,Y)=G(X,Y)+100:C1(I)=X:C2(I)=Y:NEXTI
24305 I=INT(D0):?:S0=0
24310 T2=FNA(1):T3=FNA(1):IFG(T2,T3)<100THEN24310
24320 IFS8<>1THEN24440
24330 ?"IT IS STARDATE";I;"...THE ORGANIAN PEACE TREATY BETWEEN"
24340 ?"THE UNITED FEDERATION OF PLANETS AND THE KLINGON EMPIRE"
24350 ?"HAS COLLAPSED AND THE FEDERATION IS BEING ATTACKED BY A"
24360 ?"DEADLY KLINGON INVASION FLEET. AS CAPTAIN OF THE STARSHIP"
24370 ?"U.S.S. ENTERPRISE, IT IS YOUR MISSION TO SEEK OUT AND"
24380 ?"DESTROY THIS INVASION FORCE OF";I1;"BATTLE CRUISERS."
24390 ?:?"YOU HAVE AN INITIAL ALLOTMENT OF";INT(I5);
24400 ?"STARDATES":?"TO COMPLETE YOUR MISSION."
24410 ?"AS THE MISSION PROCEEDS, YOU MAY BE GIVEN MORE TIME."
24420 ?:?"YOU WILL HAVE";I2;"SUPPORTING STARBASE(S).":?
24430 GOTO24515
24440 ?"STARDATE..............";I
24450 ?"NUMBER OF KLINGONS....";I1
24460 ?"NUMBER OF STARDATES...";INT(I5)
24470 ?"NUMBER OF STARBASES...";I2
24480 ?"STARBASE LOCATIONS....";
24490 FORI=1TOI2:?B2(I);"-";B3(I);
24500 IFI<>I2THEN?", ";
24510 NEXTI:?:?
24515 GOSUB18400
24520 ?"THE ";S5$;" IS CURRENTLY IN THE ";G2$;" QUADRANT."
24530 GOSUB18000
24531 ?:INPUT"READY TO CONTINUE";NL$:?CHR$(26):GOSUB29002:GOSUB14001:RETURN
25010 INPUT"WARP FACTOR";K
25020 ?
25025 IFK<1THEN25140
25026 IFK>10THEN25150
25030 J=W1:W1=K:W2=W1*W1
25040 IF(W1<=J)OR(W1<=6)THEN25070
25050 IFW1<=8THEN25080
25060 IFW1>8THEN25100
25070 ?"'WARP FACTOR";W1;"CAPTAIN'":RETURN
25080 ?"*** OUR MAXIMUM SAFE SPEED IS WARP 6":RETURN";
25100 IFW1=10THEN25130
25110 ?"*** CAPTAIN, OUR ENGINES MAY NOT TAKE IT !":RETURN
25130 ?"-'AYE, CAPTAIN, WE'LL GIVE IT A TRY.'":RETURN
25140 ?"-'WE CAN'T GO BELOW WARP 1, CAPTAIN.'":RETURN
25150 ?"-'OUR TOP SPEED IS WARP 10, CAPTAIN.'"
25160 RETURN
26001 J3=0:IFD4(8)<>0THEN26600
26010 IFS4<>0THEN26530
26500 INPUT"SHIELDS ARE DOWN. DO YOU WANT THEM UP";B$
26510 IFLEFT$(B$,1)="Y"THEN26560
26520 RETURN
26530 INPUT"SHIELDS ARE UP. DO YOU WANT THEM DOWN";B$
26540 IFLEFT$(B$,1)="Y"THEN26590
26550 RETURN
26560 S4=1:S9=1:IFC5$<>"DOCKED"THENE1=E1-50
26570 ?"SHIELDS RAISED.":IFE1<=0THEN26610
26580 J3=1:RETURN
26590 S4=0:S9=1:?"SHIELDS LOWERED.":J3=1:RETURN
26600 ?"SHIELDS DAMAGED AND DOWN. ":RETURN
26610 ?:?"SHIELDS CONSUME ALL ENERGY."
26620 F9=4:GOSUB10000:RETURN
27000 IFX2<>0THEN27100
27010 N=INT(RND(1)*I6+1):FORX=1TO8:FORY=1TO8
27020 N=N-(G(X,Y)-INT(G(X,Y)/10)*10):IFN<=0THEN27040
27030 NEXTY:NEXTX:RETURN
27040 IF(X<>Q1)OR(Y<>Q2)THEN27150
27050 IFJ4<>0THEN27150
27060 N=INT(RND(1)*(G(X,Y)-INT(G(X,Y)/10)*10))+1
27070 FORX3=1TO10:FORY3=1TO10:IFQ$(X3,Y3)<>"*"THEN27090
27080 N=N-1:IFN=0THEN27100
27090 NEXTY3:NEXTX3
27100 ?:?"*** RED ALERT!! RED ALERT!! ***
27105 X3=X2:Y3=Y2
27110 ?"*** INCIPIENT SUPERNOVA DETECTED AT SECTOR";X3;"-";Y3
27120 X=Q1:Y=Q2:K=(X2-S6)^2+(Y2-S7)^2
27130 IFK>1.5THEN27180
27140 ?"*** EMERGENCY AUTO-OVERRIDE JAMMED ***":A2=1:GOTO27180
27150 IFD4(9)<>0THEN27180
27160 ?:?"MESSAGE FROM STARFLEET COMMAND...STARDATE";INT(D0)
27170 ?"'SUPERNOVA IN QUADRANT";X;"-";Y;
27175 ?"....CAUTION ADVISED'"
27180 N=G(X,Y):R=INT(N/100):Q=0
27190 IF(X<>Q1)OR(Y<>Q2)THEN27210
27200 K3=0:C3=0
27210 IFR=0THEN27270
27220 R1=R1-R:IFR2=0THEN27270
27230 FORL=1TOR2:IF(C1(L)<>X)OR(C2(L)<>Y)THEN27260
27240 C1(L)=C1(R2):C2(L)=C2(R2):C1(R2)=0:C2(R2)=0
27250 R2=R2-1:R=R-1:Q=1:IFR2=0THENF1(2)=1E+30
27260 NEXTL
27270 IFR3=0THEN27310
27280 FORL=1TOR3:IF(B2(L)<>X)OR(B3(L)<>Y)THEN27300
27290 B2(L)=B2(R3):B3(L)=B3(R3):B2(R3)=0:B3(R3)=0:R3=R3-1
27300 NEXTL
27310 IFX2=0THEN27350
27320 N=G(X,Y)-INT(G(X,Y)/100)*100
27330 S1=S1+(N-INT(N/10)*10):B1=B1+INT(N/10)
27340 K1=K1+R:K2=K2+Q
27350 IF(S2(X,Y)<>0)AND(D4(9)<>0)THENS2(X,Y)=LQ+G(X,Y)
27360 IF(D4(9)=0)OR((Q1=X)AND(Q2=Y))THENS2(X,Y)=1
27370 G(X,Y)=1000
27380 IF(R1<>0)OR((X=Q1)AND(Y=Q2))THEN27430
27390 ?CHR$(26):?"*** SUPERNOVA IN QUADRANT";X;"-";Y;"HAS DESTROYED THE"
27400 ?"REMAINDER OF THE ENEMY FLEET !!"
27420 F9=1:GOSUB10010:RETURN
27430 IFA2=0THENRETURN
27440 F9=8:GOSUB10010:RETURN
28000 IFK3<=1THENRETURN
28010 Z4=0:FORO=1TOK3-1:IFK7(O)<=K7(O+1)THEN28080
28020 K=K7(O):K7(O)=K7(O+1):K7(O+1)=K
28030 K=K8(O):K8(O)=K8(O+1):K8(O+1)=K
28040 K=K4(O):K4(O)=K4(O+1):K4(O+1)=K
28050 K=K5(O):K5(O)=K5(O+1):K5(O+1)=K
28060 K=K6(O):K6(O)=K6(O+1):K6(O+1)=K
28070 Z4=1
28080 NEXTO
28090 IFZ4<>0THEN28010
28100 RETURN
29002 IFD(1)<>0THEN29230
29010 ?:?" 1 2 3 4 5 6 7 8 9 10"
29020 FORI=1TO10:IFI<10THEN?" ";
29030 ?I;:FORJ=1TO10:?Q$(I,J);" ";:NEXTJ
29040 ONIGOTO29050,29060,29080,29090,29140
29045 ONI-5GOTO29150,29160,29170,29200,29210
29050 ?" STARDATE ";FNR(D0):GOTO29220
29060 IFC5$<>"DOCKED"THENGOSUB17000
29070 ?" CONDITION ";C5$:GOTO29220
29080 ?" POSITION ";Q1;"-";Q2;", ";S6;"-";S7:GOTO29220
29090 ?" LIFE SUPPORT ";:IFD4(5)<>0THEN29110
29100 ?"ACTIVE":GOTO29220
29110 IFC5$<>"DOCKED"THEN29130
29120 ?"DAMAGED, SUPPORTED BY STARBASE":GOTO29220
29130 ?"DAMAGED, RESERVES=";FNS(L1):GOTO29220
29140 ?" WARP FACTOR ";FNR(W1):GOTO29220
29150 ?" ENERGY";SPC(8);.01*INT(100*E1):GOTO29220
29160 ?" TORPEDOS ";T4:GOTO29220
29170 ?" SHIELDS ";:B$="DOWN,":IFS4<>0THENB$="UP,"
29180 IFD4(8)>0THENB$="DAMAGED,"
29190 ?B$;INT(100*S3/I8+.5);"%":GOTO29220
29200 ?" KLINGONS LEFT ";R1:GOTO29220
29210 ?" TIME LEFT ";FNS(R5)
29220 NEXTI:RETURN
29230 ?"SHORT RANGE SENSORS DAMAGED.":RETURN
30001 ?:?"*** TIME WARP ENTERED ***":?"YOU ARE TRAVELING ";
30010 IFS0<>0THEN30050
30020 T1=-.5*I5*LOG(RND(1))
30030 ?"FORWARD IN TIME";FNR(T1);"STARDATES."
30040 F1(2)=F1(2)+T1:GOTO30200
30050 M=D0:D0=D9(1)
30060 ?"BACKWARD IN TIME";FNR(M-D0);"STARDATES.":S0=0
30070 R1=D9(2):R2=D9(3):R3=D9(4):R4=D9(5):R5=D9(6)
30080 S1=D9(7):B1=D9(8):K1=D9(9):K2=D9(10)
30090 FORI=1TO8:FORJ=1TO8:G(I,J)=D9(I-1+8*(J-1)+11):NEXTJ:NEXTI
30100 FORI=75TO84:C1(I-74)=D9(I):NEXT
30110 FORI=85TO94:C2(I-84)=D9(I):NEXT
30120 FORI=95TO99:B2(I-94)=D9(I):NEXT
30130 FORI=100TO104:B3(I-99)=D9(I):NEXT:B4=D9(105):B5=D9(106)
30140 F1(1)=D0-.5*I5*LOG(RND(1))
30150 IFR2<>0THENF1(2)=D0-(I5/R2)*LOG(RND(1))
30160 F1(3)=D0-.5*I5*LOG(RND(1))
30170 FORI=1TO8:FORJ=1TO8:IF1<S2(I,J)THENS2(I,J)=1
30180 NEXTJ:NEXTI
30185 ?
30190 ?"SPOCK HAS RECONSTRUCTED A CORRECT STAR CHART FROM MEMORY."
30200 GOSUB18000:RETURN
31001 J3=0:IFD4(12)<>0THEN31120
31020 INPUT"NUMBER OF UNITS TO SHIELDS";Z3
31030 IFZ3<0THENRETURN
31040 IFE1+S3-Z3>0THEN31060
31050 ?"SCOTT HERE- 'WE ONLY HAVE";FNR(E1+S3);"UNITS LEFT.'"
31051 RETURN
31060 E1=E1+S3-Z3:S3=Z3:?"--ENERGY TRANSFER COMPLETE--"
31070 ?"(SHIP ENERGY=";FNR(E1);" SHIELD ENERGY=";FNR(S3);")"
31075 J3=1
31080 T1=.1:P5=(K3+4*C3)/48:IFP5<.1THENP5=.1
31090 IFP5>RND(1)THENGOSUB1000
31100 IFA2<>0THENRETURN
31110 GOSUB9000:RETURN
31120 ?"TRANSFER PANEL DAMAGED.":RETURN
32001 INPUT"WHICH DIRECTION";Z
32002 IFZ<.01ORZ>12THENGOSUB40000ELSE32020
32005 J3=0:RETURN
32020 T1=.05:P=(K3+4*C3)/48:IFP<.05THENP=.05
32030 IFP>RND(1)THENGOSUB1000
32040 IFA2<>0THENRETURN
32050 GOSUB9000:J3=1:IFA2<>0THENRETURN
32080 D5=INT((Z/12)*8+1.5):IFD5>8THEND5=1
32085 FORI=1TO5:FORJ=1TO5:V$(I,J)=" ":NEXTJ:NEXTI:N=0
32087 V$(3,3)=LEFT$(S5$,1)
32090 OND5GOTO32100,32130,32150,32170,32190,32220,32260,32300
32100 I=S6-2:J=S7-2:V$(1,1)=Q$:IF(J>0)AND(I>0)THENV$(1,1)=Q$(I,J)
32110 I=S6-1:J=S7-1:V$(2,2)=Q$:IF(I>0)AND(J>0)THENV$(2,2)=Q$(I,J)
32120 N=N+1:IFN=3THEN32350
32125 I=S6-2:V$(1,2)=Q$:IF(I>0)AND(J>0)THENV$(1,2)=Q$(I,J)
32130 I=S6-2:V$(1,3)=Q$:IFI>0THENV$(1,3)=Q$(I,S7)
32135 I=S6-1:V$(2,3)=Q$:IFI>0THENV$(2,3)=Q$(I,S7)
32140 N=N+1:IFN=3THEN32350
32145 I=S6-2:J=S7+1:V$(1,4)=Q$:IF(I>0)AND(J<11)THENV$(1,4)=Q$(I,J)
32150 I=S6-2:J=S7+2:V$(1,5)=Q$:IF(I>0)AND(J<11)THENV$(1,5)=Q$(I,J)
32155 I=S6-1:J=S7+1:V$(2,4)=Q$:IF(I>0)AND(J<11)THENV$(2,4)=Q$(I,J)
32160 N=N+1:IFN=3THEN32350
32165 J=S7+2:V$(2,5)=Q$:IF(I>0)AND(J<11)THENV$(2,5)=Q$(I,J)
32170 J=S7+2:V$(3,5)=Q$:IFJ<11THENV$(3,5)=Q$(S6,J)
32175 J=S7+1:V$(3,4)=Q$:IFJ<11THENV$(3,4)=Q$(S6,J)
32180 N=N+1:IFN=3THEN32350
32185 I=S6+1:J=S7+2:V$(4,5)=Q$:IF(I<11)AND(J<11)THENV$(4,5)=Q$(I,J)
32190 I=S6+2:J=S7+2:V$(5,5)=Q$:IF(I<11)AND(J<11)THENV$(5,5)=Q$(I,J)
32195 I=S6+1:J=S7+1:V$(4,4)=Q$:IF(I<11)AND(J<11)THENV$(4,4)=Q$(I,J)
32200 N=N+1:IFN=3THEN32350
32210 I=S6+2:V$(5,4)=Q$:IF(I<11)AND(J<11)THENV$(5,4)=Q$(I,J)
32220 I=S6+2:V$(5,3)=Q$:IFI<11THENV$(5,3)=Q$(I,S7)
32230 I=S6+1:V$(4,3)=Q$:IFI<11THENV$(4,3)=Q$(I,S7)
32240 N=N+1:IFN=3THEN32350
32250 I=S6+2:J=S7-1:V$(5,2)=Q$:IF(I<11)AND(J>0)THENV$(5,2)=Q$(I,J)
32260 I=S6+2:J=S7-2:V$(5,1)=Q$:IF(I<11)AND(J>0)THENV$(5,1)=Q$(I,J)
32270 I=S6+1:J=S7-1:V$(4,2)=Q$:IF(I<11)AND(J>0)THENV$(4,2)=Q$(I,J)
32280 N=N+1:IFN=3THEN32350
32290 J=S7-2:V$(4,1)=Q$:IF(I<11)AND(J>0)THENV$(4,1)=Q$(I,J)
32300 J=S7-2:V$(3,1)=Q$:IFJ>0THENV$(3,1)=Q$(S6,J)
32310 J=S7-1:V$(3,2)=Q$:IFJ>0THENV$(3,2)=Q$(S6,J)
32320 N=N+1:IFN=3THEN32350
32330 I=S6-1:J=S7-2:V$(2,1)=Q$:IF(I>0)AND(J>0)THENV$(2,1)=Q$(I,J)
32340 GOTO32100
32350 FORI=1TO5
32360 IF(V$(I,1)=" ")AND(V$(I,3)=" ")AND(V$(I,5)=" ")THEN32390
32370 ?" ";
32380 FORJ=1TO5:?V$(I,J);" ";:NEXTJ:?
32390 NEXTI:RETURN
33001 J3=0:INPUT"HOW MANY STARDATES";Z5:IF(Z5<R5)AND(K3=0)THEN33030
33020 INPUT"ARE YOU SURE";B$:IFLEFT$(B$,1)<>"Y"THENRETURN
33030 R6=1
33040 IFZ5<=0THENR6=0
33050 IFR6=0THENRETURN
33060 T1=Z5:Z6=Z5
33070 IFK3=0THEN33100
33080 T1=1+RND(1):IFZ5<T1THENT1=Z5
33090 Z6=T1
33100 IFT1<Z5THENGOSUB1000
33110 IFA2<>0THENRETURN
33120 GOSUB9000:J3=1:IFA2<>0THENRETURN
33130 Z5=Z5-Z6:GOTO33040
34001 J3=0:IFD4(6)<>0THEN34750
34010 INPUT"ENTER COURSE...";D2:IFD2<.01ORD2>12THENGOSUB40000ELSE34013
34012 RETURN
34013 INPUT"DISTANCE...";D1:IFD1<=0THENRETURN
34030 P=(D1+.05)*W1*W1*W1*(S4+1):IFP<E1THEN34150
34040 J3=0:?:?"ENGINEERING TO BRIDGE--"
34050 IF(S4=0)OR(.5*P>E1)THEN34080
34060 ?" WE HAVEN'T THE ENERGY TO GO THAT FAR WITH";
34070 ?" THE SHIELDS UP.":RETURN
34080 W=INT((E1/(D1+.05))^.333333):IFW<=0THEN34130
34090 ?" WE HAVEN'T THE ENERGY. BUT WE COULD DO IT AT WARP";W
34100 IFS4<>0THEN34120
34110 RETURN
34120 ?" IF YOU'LL LOWER THE SHIELDS.":RETURN
34130 ?" WE CAN'T DO IT, CAPTAIN. WE HAVEN'T GOT THE ENERGY."
34140 RETURN
34150 T1=10*D1/W2:IFT1<.8*R5THEN34500
34160 ?:?"MR. SPOCK - 'CAPTAIN, I COMPUTE THAT SUCH A TRIP"
34170 ?" WILL REQUIRE APPROXIMATELY";FNR(100*T1/R5);
34180 ?"PERCENT":?" OF OUR REMAINING TIME. ARE YOU SURE ";
34190 INPUT "THIS IS WISE";B$:IFLEFT$(B$,1)="Y"THEN34500
34200 J3=0:RETURN
34500 Q4=0:W=0:IFW1<=6THEN34660
34510 P=D1*(6-W1)^2/66.6667:IFP>RND(1)THENQ4=1
34520 IFQ4<>0THEND1=RND(1)*D1
34530 W=0:IFW1<10THEN34550
34540 IF.25*D1>RND(1)THENW=1
34550 IF(Q4=0)AND(W=0)THEN34660
34560 A=(15-D2)*.5236:X1=-SIN(A):X2=COS(A)
34570 B8=ABS(X1):IFABS(X2)>ABS(X1)THENB8=ABS(X2)
34580 X1=X1/B8:Y1=Y1/B8:N=INT(10*D1*B8+.5):X=S6:Y=S7
34590 IFN=0THEN34660
34600 FORL=1TON
34610 X=X+X1:Q=INT(X+.5):IF(Q<1)OR(Q>10)THEN34660
34620 Y=Y+Y1:R=INT(Y+.5):IF(R<1)OR(R>10)THEN34660
34630 IFQ$(Q,R)="."THEN34650
34640 Q4=0:W=0
34650 NEXTL
34660 GOSUB15001:IFA2<>0THENRETURN
34670 E1=E1-D1*W1*W1*W1*(S4+1):IFE1>0THEN34690
34680 F9=4:GOSUB10000:RETURN
34690 T1=10*D1/W2:IFW<>0THENGOSUB30001
34700 IFQ4=0THEN34740
34710 ?:?"ENGINEERING TO BRIDGE--":?" SCOTT HERE- ";
34715 ?"'WE'VE JUST BLOWN THE WARP ENGINES."
34720 ?" WE'LL HAVE TO SHUT 'ER DOWN HERE, CAPTAIN.'"
34725 D4(6)=D5*(3*RND(1)+1)
34740 J3=1:RETURN
34750 ?"WARP ENGINES DAMAGED.":RETURN
35001 ONSGN(D4(10))+2GOTO35010,35030,35020
35010 ?"YE FAERIE QUEENE HAS NO SHUTTLE CRAFT.":RETURN
35020 ?"SHUTTLE CRAFT DAMAGED.":RETURN
35030 ?:?"***ABANDON SHIP! ABANDON SHIP!"
35040 ?"***ALL HANDS ABANDON SHIP!":?
35050 ?"YOU AND THE BRIDGE CREW ESCAPE IN THE GALILEO."
35060 ?"THE REMAINDER OF THE CREW BEAMS DOWN"
35070 ?"TO THE NEAREST HABITABLE PLANET.":IFR3<>0THEN35090
35080 F9=9:GOSUB10000:RETURN
35090 ?:?"YOU ARE CAPTURED BY KLINGONS AND RELEASED TO"
35100 ?"THE FEDERATION IN A PRISONER-OF-WAR EXCHANGE."
35110 ?"STARFLEET PUTS YOU IN COMMAND OF ANOTHER SHIP,"
35120 ?"THE FAERIE QUEENE WHICH IS ANTIQUATED, BUT"
35130 ?"STILL USABLE.":N=INT(RND(1)*R3+1):Q1=B2(N):Q2=B3(N)
35140 S6=5:S7=5:GOSUB18000:Q$(S6,S7)="."
35145 FORL=1TO3:S6=INT(3*RND(1)-1+B6)
35150 IF(S6<1)OR(S7>10)THEN35180
35160 S7=INT(3*RND(1)-1+B7):IF(S7<1)OR(S7>10)THEN35180
35170 IFQ$(S6,S7)="."THEN35190
35180 NEXTL:GOTO35140
35190 S5$="FAERIE QUEENE":Q$(S6,S7)=LEFT$(S5$,1):C5$="DOCKED"
35200 FORL=1TO12:D4(L)=0:NEXT:D4(10)=-1:E1=3000:I7=E1
35210 S3=1500:I8=S3:T4=6:I9=T4:L1=3:J1=L1:S4=0:W1=5:W2=25
35220 RETURN
36001 IFD4(11)=0THEN36030
36010 ?"COMPUTER DAMAGED - CANNOT EXECUTE DESTRUCT SEQUENCE"
36020 RETURN
36030 ?:?" ---WORKING---"
36040 ?"IDENTIFICATION-POSITIVE"
36050 ?"SELF-DESTRUCT-SEQUENCE-ACTIVATED":J=3
36060 FORI=10TO6STEP-1:?SPC(J);I:GOSUB36210:J=J+3:NEXT
36070 ?"ENTER-YOUR-MISSION-PASSWORD-TO-CONTINUE"
36080 ?"SELF-DESTRUCT-SEQUENCE-OTHERWISE-DESTRUCT"
36090 ?"SEQUENCE-WILL-BE-ABORTED"
36100 INPUTB$:IFB$<>X$THEN36190
36110 ?"PASSWORD-ACCEPTED":J=10
36120 FORI=5TO1STEP-1:?SPC(J);I:GOSUB36210:J=J+3:NEXT
36130 ?:?"*****ENTROPY OF ";S5$;" MAXIMIZED*****"
36140 ?:IFK3=0THEN36180
36150 W=20*E1:FORL=1TOK3:IFK6(L)*K7(L)>WTHEN36170
36160 A5=K4(L):A6=K5(L):T2$=Q$(A5,A6):GOSUB6000
36170 NEXTL
36180 F9=10:GOSUB10000:RETURN
36190 ?"PASSWORD-REJECTED"
36200 ?"CONTINUITY-EFFECTED":?:RETURN
36210 K=12345:FORM=1TO90:K=K+1:NEXTM:RETURN
37001 FORI=1TO10:GOTO29040:RETURN
40000 ?"---> COURSE(S) .01-12 ONLY !!!":RETURN