1 A=VAL(MID$(DATE$,1,2))\B=VAL(MID$(DATE$,4,2))\C=VAL(MID$(DATE$,9,2)) 4 D=VAL(MID$(TIME$,1,2))\E=VAL(MID$(TIME$,4,2))\F=VAL(MID$(TIME$,7,2)) 7 ABCDEF=A*(A+B+C+D+E+F) 10 RANDOMIZE ABCDEF 12 REM 14 REM TREK5 VAX VMS BASIC CODE FROM LATE 1970s/EARLY 1980s - HAND TYPED BY DAN GAHLINGER 15 REM SEPT 27/2022 - SEPT 30/2022 - OPEN-SOURCE, NO COPYRIGHT KNOWN FREE TO USE AS YOU WISH 16 REM EMAIL: DAN@ZEROFUSION.COM 17 REM SEE HTTPS://ZEROFUSION.COM/TREK7 FOR CODE REPOSITORY 18 REM AND HTTPS://ZEROFUSION.COM/NEWCASTLE FOR UPDATES TO THE NEW CASTLE 19 REM 20 PRINT TAB(24);" ,------*------," 30 PRINT TAB(24);",------------- '--- ------'" 40 PRINT TAB(24);" '------- --' / /" 50 PRINT TAB(24);" ,---\\--------/ /--," 60 PRINT TAB(24);" '-----------------'"\PRINT 70 PRINT TAB(24);"The USS Enterprise --- NCC-1701" 80 FOR I=1 TO 5\PRINT\NEXT I 100 Z$=" " 110 DIM G(8,8),C(9,2),K(4,4),N(3),Z(8,8),D(8) 120 T=INT(RAND*20+20)*100\T0=T\T9=25+INT(RND*10)\D0=0\E=30000\E0=E 130 P=10\P0=P\S9=1000\S=0\B9=0\K9=0\X$=""\X0$="'s"\STARDS=0 140 DEF FND(D)=SRQ((K(I,1)-S1)^2+(K(I,2)-S2)^2) 150 DEF FNR(R)=INT(RND*7.98+1.01) 160 REM 170 Q1=FNR(2)\Q2=FNR(2)\S1=FNR(1)\S2=FNR(1) 180 FOR I=1 TO 9\C(I,1)=0\C(I,2)=0\NEXT I 190 C(3,1)=-1\C(2,1)=-1\C(4,1)=-1\C(4,2)=-1\C(5,2)=-1\C(6,2)=-1 200 C(1,2)=1\C(2,2)=1\C(6,1)=1\C(7,1)=1\C(8,1)=1\C(8,2)=1\C(9,2)=1 210 FOR I=1 TO 8\D(I)=0\NEXT I 220 A1$="NAVSRSLRSPHATORSHEDAMCOMXXX" 230 REM 240 REM 250 FOR I=1 TO 8\FOR J=1 TO 8\K3=0\Z(I,J)=0\R1=RND 260 IF R1>.95 THEN K3=4\K9=K9+4\GOTO 300 270 IF R1>.9 THEN K3=3\K9=K9+3\GOTO 300 280 IF R1>.8 THEN K3=2\K9=K9+2\GOTO 300 290 IF R1>.75 THEN K3=1\K9=K9+1 300 B3=0\IF RND>.96 THEN B3=1\B9=B9+1 310 G(I,J)=K3*100+B3*10+FNR(1)\NEXT J\NEXT I\IF K9>T9 THEN T9=K9+1 320 IF B9<>0 THEN 350 330 IF G(Q1,Q2)<200 THEN G(Q1,Q2)=G(Q1,Q2)+100\K9=K9+1 340 B9=1\G(Q1,Q2)=G(Q1,Q2)+10\Q1=FNR(1)\Q2=FNR(1) 350 K7=K9\IF B9>1 THEN X$="s"\X0$=" are" 360 SYM$=" E " 370 PRINT "Your orders are as follows" 380 PRINT "Rid thine Galaxy of the";K9;"Klingons" 390 PRINT "before the Klingons rid the Galaxy of Thee!" 400 PRINT "You have";T9;"days, and there";X0$;B9;"Starbase";X$ 410 PRINT "in the Galaxy for re-supplying all ye who waste most of" 420 PRINT "their energy..." 430 PRINT\PRINT "When a message is important the computer will beep." 440 PRINT "Do not ignore messages of this nature." 450 PRINT\INPUT "Please register your last name in the Ships' Log " ;GARB$ 460 REM 470 Z4=Q1\Z5=Q2\K3=0\B3=0\S3=0\G5=0\D4=.5*RND\Z(Q1,Q2)=G(Q1,Q2) 480 IF Q1<1 OR Q1>8 OR Q2<1 OR Q2>8 THEN 630 490 GOSUB 4100\PRINT\IF T0<>T THEN 520 500 PRINT "Your mission begins with your starship located" 510 PRINT "in the galactic quadrant, '";G2$;"'."\GOTO 550 520 FOR I=1 TO 2000\NEXT I 530 PRINT " * ZOOM! *" 540 PRINT " We just entered ";G2$;" Quandrant." 550 PRINT\K3=INT(G(Q1,Q2)*.01)\B3=INT(G(Q1,G2)*.1)-10*K3 560 S3=G(Q1,Q2)-100*K3-10*B3\IF K3=0 THEN 620 570 PRINT CHR$(7);CHR$(7);CHR$(7) 580 PRINT "Combat Area! Condition *RED ALERT*"\IF S>200 THEN 620 590 PRINT "Spock: Captain, Either boost Shields, or kiss your you know"; 600 PRINT " Good-bye!"\PRINT "Dr. McCoy is passing out the Cynaide Tablets..." 605 REM --- COMMENT ADDED SEPT 29/2022 ----------------------------- END OF PAGE 1 610 PRINT "Captain: I have put 10000 units of energy to the shields"\S=10000\E=E-S 620 FOR I=1 TO 4\K(I,1)=0\K(I,2)=0\K(I,3)=0\K(I,4)=0\NEXT I 630 Q$=Z$+Z$+Z$+Z$+Z$+Z$+Z$+LEFT$(Z$,24) 640 REM 650 REM 660 A$=SYM$\Z1=S1\Z2=S2\GOSUB 3890\IF K3<1 THEN 690 670 FOR I=1 TO K3\GOSUB 3860\A$=" K "\Z1=R1\Z2=R2\IF RND>.85 THEN K(I,4)=1 680 GOSUB 3890\K(I,1)=R1\K(I,2)=R2\K(I,3)=S9*(.5*RND)\NEXT I 690 IF B3<1 THEN 710 700 GOSUB 3860\A$=" B "\Z1=R1\B4=R1\Z2=R2\B5=R2\GOSUB 3890 710 FOR I=1 TO S3\GOSUB 3860\A$=" * "\Z1=R1\Z2=R2\GOSUB 3890\NEXT I\GOSUB 2620 720 GOSUB 2880 730 IF S+E>10 THEN IF E>10 OR D(6)>0 THEN 820 740 PRINT\PRINT "Now you've *REALLY* done it!" 750 PRINT "You've just stranded your ship in Space!" 760 PRINT "You have insufficient maneuvering energy," 770 PRINT "and Chief Engineer Scott just swallowed those" 780 PRINT "Cyanide Tablets, so he won't be able to Cross-Circuit" 790 PRINT "to the Engine Room!!" 800 PRINT "and Shield Control is presently incapable of Cross-Circuiting"; 810 PRINT " to the Engine Room!!"\ GOTO 7240 820 PRINT\PRINT "What should we do now, Captain ";GARB$; 825 INPUT A$ 830 FOR I=1 TO 9\IF LEFT$(A$,3)<>MID$(A1$,3*I=2,3) THEN 850 840 ON I GOTO 960,720,1660,1750,1960,2350,2450,3140,2770 850 NEXT I\PRINT "Enter one of the following :" 860 PRINT" NAV (To set course)" 870 PRINT" SRS (For Short Range Sensor Scan)" 880 PRINT" LRS (For Long Range Sensor Scan)" 890 PRINT" PHA (To Fire Phasers)" 900 PRINT" TOR (To Fire Photon Torpedos)" 910 PRINT" SHE (To Raise or Lower Shields)" 920 PRINT" DAM (For Damage Control Reports)" 930 PRINT" COM (To Call on Library Computer)" 940 PRINT" XXX (To Resign Your Command)"\PRINT\GOTO 730 950 REM 960 INPUT "Course (1-9) ";C1\IF C1=9 THEN C1=1 970 IF C1>=1 AND C1<9 THEN 990 980 PRINT "Sulu: No understand. Prease Spreak Engrish!"\GOTO 840 990 X$="8"\IF D(1)<0 THEN X$="0.2" 1000 PRINT "Warp Factor (0-";X$;")";\INPUT W1 1005 IF D(1)<0 AND W1>.2 THEN 1050 1010 IF W1>0 AND W1<8 THEN 1060 1020 IF W1=0 THEN 840 1030 PRINT "Chief Engineer Scott: The engines won't take warp";W1;"!"\GOTO 840 1050 PRINT "Warp engines are damaged. Maximum Speed = War 0.2"\GOTO 840 1060 N=INT(W1*8+.5)\IF E=N>=0 THEN 1140 1070 PRINT "Engineeering Reports 'Insufficient energy available" 1080 PRINT " for maneuvering at warp";W1;"!'" 1090 IF S1 THEN D6=1 1180 FOR I=1 TO 8\IF D(I)>=0 THEN 1230 1190 D(I)=D(I)+D6\IF D(I)>-.1 AND D(I)<0 THEN D(I)=-.1\GOTO 1230 1200 IF D(I)<0 THEN 1230 1210 IF D1<>1 THEN D1=1\PRINT "Damage Control Report: "; 1215 REM --- COMMENT ADDED SEPT 29/2022 ---------------------------- END OF PAGE 2 1220 PRINT TAB(8);\R1=I\GOSUB 3950\PRINT G2$;" Repair Completed." 1225\PRINT CHR$(7);CHR$(7);CHR$(7) 1230 NEXT I\IF RND>.2 THEN 1300 1240 R1=FNR(1)\IF RND>.6 THEN 1270 1243 DAM=RND*5+1\SDAM=INT(DAM*(RND*100)) 1245 IF INT(S/100)>50 OR DAM>2.5 THEN IF S"\GOTO 1300 1250 D(R1)=D(R1)-DAM\PRINT "Damage Control Report: "; 1260 GOSUB 3950\PRINT G2$;" damaged"\PRINT\GOTO 1300 1270 D(R1)=D(R1)+RND*3+1\PRINT "Damage Control Report\ "; 1280 GOSUB 3950\PRINT G2$;" state of repair improved"\PRINT 1290 REM 1300 A$=" "\Z1=INT(S1)\Z2=INT(S2)\GOSUB 3890 1310 X1=C(C1,1)+(C(C1+1,1)-C(C1,1))*(C1-INT(C1))\X=S1\Y=S2 1320 X2=C(C1,2)+(C(C1+1,2)-C(C1,2))*(C1-INT(C1))\Q4=S1\Q5=Q2 1330 FOR I=1 TO N\S1=S1+X1\S2=S2+X2\IF S1<1 OR S1>=9 OR S2<1 OR S2>=9 THEN 1440 1340 S8=INT(S1)*24+INT(S2)*3-26\IF MID$(Q$,S8,2)=" " THEN 1370 1350 S1=INT(S1-X1)\S2=INT(S2-X2)\PRINT "Warp engines shut down at "; 1351 IF D(2W)<0 THEN PRINT "sector";S1;",";S2;"due to an obstruction."\GOTO 1380 1360 PRINT "sector";S1;",";S2;"due to Captain's stupidity."\GOTO 1380 1370 NEXT I\S1=INT(S1)\S2=INT(S2) 1380 A$=SYM$\Z1=INT(S1)\Z2=INT(S2)\GOSUB 3890\GOSUB 1610\T8=1 1390 IF W1<1 THEN T8=.1*INT(10*W1) 1400 T=T+T8\IF T>T0+T9 THEN 2740 1410 REM 1420 GOTO 720 1430 REM 1440 X=8*Q1+X+N*X1\Y=8*Q2+Y+N*X2\Q1=INT(X/8)\Q2=INT(Y/8)\S1=INT(X-Q1*8) 1450 S2=INT(Y-Q2*8)\IF S1=0 THEN Q1=Q1-1\S1=8 1460 IF S2=0 THEN Q2=Q2-1\S2=8 1470 X5=0\IF Q1<1 THEN X5=1\Q1=1\S1=1 1480 IF Q1>8 THEN X5=1\Q1=8\S1=8 1490 IF Q2<1 THEN X5=1\Q2=1\S2=1 1500 IF Q2>8 THEN X5=1\Q2=8\S2=8 1510 IF X5=0 THEN 1580 1520 PRINT "Uhura: Message from Starfleet Command\" 1530 PRINT " 'Permission to attempt crossing of galactic perimeter" 1540 PRINT " is hereby **DENIED**. Shut down your engines.'" 1550 PRINT "Chief Engineer Scott reports 'Warp engines shut down" 1560 PRINT " at Sector";S1;",";S2;"of Quadrant";Q1;",";Q2;".'" 1570 IF T>T0+T9 THEN 2740 1580 IF 8*Q1+Q2=8*Q4+Q5 THEN 1380 1590 T=T+1\GOSUB 1610\GOTO 470 1600 REM 1610 E=E-N-10\IF E>=0 THEN RETURN 1620 PRINT "Shield control supplies energy to complete the maneuver." 1630 S=S+E\E=0\IF S<=0 THEN S=0 1640 RETURN 1650 REM 1660 IF D(3)<0 THEN PRINT "Spock: Give me time to fix them, Captain!"\GOTO 730 1670 PRINT "Long range scan for Quadrant";Q1;",";Q2 1680 O1$="--------------------"\PRINT O1$ 1690 FOR I=Q1-1 TO Q1+1\N(1)=-1\N(2)=02\N(3)=-3\FOR J=Q2-1 TO Q2+1 1700 IF I>0 AND I<9 AND J>0 AND J<9 THEN N(J-Q2+2)=G(I,J)\Z(I,J)=G(I,J) 1710 NEXT J\FOR L=1 TO 3\PRINT "\ ";\IF N(L)<0 THEN PRINT "*** ";\GOTO 1730 1720 PRINT MID$(STR$(N(L)+1000),3,3);" "; 1730 NEXT L\PRINT "\"\PRINT O1$\NEXT I\GOTO 730 1740 REM 1745 REN IN THE ORIGINAL PRINTOUT THIS LINE DOESN'T EXIST, IT WAS LEFT AS A BLANK SPACE - COMMENT ADDED SEPT 29/2022 1750 IF D(4)<0 THEN PRINT "Phasers inoperable. (Sulu went for a coffee.)"\GOTO 730 1755 REM --- COMMENT ADDED SEPT 29/2022 ---------------------------- END OF PAGE 3 1760 IF K3>0 THEN 1790 1770 PRINT "Science Officer Spock: But Captain, there's nobody" 1780 PRINT "here to destroy!(except maybe us...)"\GOTO 820 1790 IF D(8)<0 THEN PRINT "Computer failure hampers accuracy" 1800 PRINT "Phasers locked on target; "; 1810 PRINT "Energy available =";E;"units" 1820 INPUT "Number of units to fire";X\IF X<=0 THEN 730 1830 IF E-X<0 THEN 1810 1840 E=E-X\IF D(8)<0 THEN X=X*RND 1850 H1=INT(X/K3)\FOR I=1 TO 4\IF K(I,3)<=0 THEN 1940 1860 H=INT(H1/FND(0))*(RND+2)\IF H>.15*K(I,3) THEN 1880 1870 PRINT "Sensors show no damage to enemy at";K(I,1);",";K(I,2)\GOTO 1940 1880 K(I,3)=K(I,3)-H\PRINT H;"Unit hit on Klingon at sector";K(I,1);",";K(I,2) 1890 IF K(I,3)>0 THEN 1910 ELSE PRINT "* F L A S H *"\FOR ZZ=1 TO 2000\NEXT ZZ 1900 PRINT "**Klingon destroyed**(Yay!)"\GOTO 1920 1910 PRINT " (Sensors show";K(I,3);"units remaining)"\GOTO 1940 1920 K3=K3-1\K9=K9-1\Z1=K(I,1)\Z2=K(I,2)\A$=" "\GOSUB 3890 1930 K(I,3)=0\G(Q1,Q2)=G(Q1,G2)-100\Z(Q1,Q2)=G(Q1,Q2)\IF K9<=0 THEN 2840 1940 NEXT I\GOSUB 2620\GOTO 730 1950 REM 1955 REM ORIGINAL LINE WAS BLANK, DID NOT EXIST - ADDED SEPT 29/2022 1960 IF P<=0 THEN PRINT "Whatsa matta wit' you?! You use-a dem all up!"\GOTO 730 1970 IF D(5)<0 THEN GOSUB 4530\GOTO 730 1990 INPUT "Photon Torpedo course (1-9)";C1\IF C1=9 THEN C1=1 2000 IF C1>=1 AND C1<9 THEN 2040 2010 PRINT "Chekov\ Keptin, I no able to do that!"\FOR I=1 TO 2000\NEXT I 2020 PRINT "Lt. Uhura is tipping the bottle..." 2030 GOTO 730 2035 REM ORIGINAL LINE WAS BLANK, DID NOT EXIST - ADDED SEPT 29/2022 2040 X1=C(C1,1)+((C(C1-INT(C1),1)+C(INT(C1)+1,1))-C(C1,1))*(C1-INT(C1))\E=E-2\P=P-1 2045 REM ORIGINAL LINE WAS BLANK, DID NOT EXIST - ADDED SEPT 29/2022 2050 X2=C(C1,2)+((C(C1-INT(C1),2)+C(INT(C1)+1,2))-C(C1,2))*(C1-INT(C1))\X=S1\Y=S2 2060 PRINT "Torpedo Track:" 2070 X=X+X1\Y=Y+X2\X3=INT(X+.5)\Y3=INT(Y+.5) 2080 IF X3<1 OR X3>8 OR Y3<1 OR Y3>8 THEN 2330 2090 PRINT " ";X3;",";Y3\A$=" "\Z1=X\Z2=Y\GOSUB 4050 2100 IF Z3<>0 THEN 2070 2110 A$=" K "\Z1=X\Z2=Y\GOSUB 4050\IF Z3=0 THEN 2170 2112 FOR I=1 TO K3\IF K(I,4)<>1 THEN 2116 2113 PRINT "Spock: It is useless to shoot at something" 2114 PRINT "that has a cloaking device activated, so I" 2115 PRINT "suggest that you use your phasers"\GOTO 2300 2116 NEXT I 2120 PRINT "**Klingon Destroyed**(Good strategy, Captain ";GARB$;")" 2130 K3=K3-1\K9=K9-1\IF K9=0 THEN 2840 2140 FOR I=1 TO 4\IF X3=K(I,1) AND Y3=K(I,2) THEN 2160 2150 NEXT I\I=4 2160 K(I,3)=0\GOTO 2290 2170 A$=" * "\Z1=X\Z2=Y\GOSUB 4050\STZ3=RND\IF Z3=0 THEN 2270 2180 IF STZ3=.4 THEN 2240 2185 IF STARDS<10 THEN 2240 2190 PRINT "Star at";X3;",";Y3;"goes supernova" 2200 PRINT "destroying everything within the quadrant," 2210 PRINT "including *YOU*! (Thank God...)" 2220 IF STARTS<=5 THEN 2230 ELSE PRINT "HA HA!! I warned you now you're dead" 2225 PRINT "Now DON'T do that again (FOOL)." 2230 PRINT\PRINT\STARDS=0\GOTO 2800 2240 STARDS=STARDS+1\PRINT "Star at";X3;",";XY;"has been destroyed" 2245 REM --- COMMENT ADDED SEPT 29/2022 ---------------------------- END OF PAGE 4 2250 IF STARDS>5 THEN PRINT "Are you having fun destroying stars, but be"\PRINT "careful you might destroy yourself" 2260 PRINT\PRINT\PRINT\S3=S3-1\STFLG=1\GOTO 2290 2270 A$=" B "\Z1=X\Z2=Y\GOSUB 4050\IF Z3=0 THEN 1990 2280 PRINT "Starbases don't like *TRAITORS*..."\GOTO 4350 2290 Z1=Z\Z2=Y\A$=" "\GOSUB 3890 2300 G(Q1,Q2)=K3*100+B3*10+S3\Z(Q1,Q2=G(Q1,Q2)\GOSUB 2620 2310 IF STFLG=1 THEN STFLG=0\GOSUB 2880\GOTO 730 2320 GOTO 730 2330 PRINT "Computer: Ha Ha! Torpedo missed."\GOSUB 2620\GOTO 730 2340 REM 2350 IF D(6)<0 THEN PRINT "Shield Control ##!?%$.(No work now!)"\GOTO 730 2360 PRINT "Energy available =";E+S;"\INPUT "Number of units to shields";X 2370 IF X<0 OR S=X THEN PRINT ""\GOTO 730 2380 IF X"\GOTO 730 2420 E=E+S-X\S=X\PRINT "Deflector Control Room Report\" 2425 REM ORIGINAL LINE WAS BLANK, DID NOT EXIST - ADDED SEPT 29/2022 2430 PRINT "'Shields now at";INT(S);"units per your command.'"\GOSUB 2880\GOTO 730 2440 REM DAMAGE CONTROL 2450 IF D(7)>=0 THEN 2570 2460 PRINT "Spock stuck (by his ears) in Jefferies Tubes. Damage Control Report" 2470 PRINT "not available until we get him loose..."\IF D0=0 THEN 730 2480 D3=0\FOR I=1 TO8\IF D(I)<0 THEN D3=D3+.1 2490 NEXT I\IF D3=0 THEN 730 2500 PRINT\D3=D3+D4\IF D3>=1 THEN D3=.9 2510 PRINT "Technicians standng by to effect reports to your ship;" 2520 PRINT "estimated time to repair\";.01*INT(100*D3);"stardates." 2530 INPUT "Will you authorize the repair order (Y/N)";A$ 2540 IF A$<>"Y" THEN 730 2550 FOR I=1 TO 8\IF D(I)<0 THEN D(I)=0 2560 NEXT I\T=T+D3+.1 2570 PRINT\PRINT "DEVICE STATE OF REPAIR"\FOR R1=1 TO 8 2580 GOSUB 3950\PRINT G2$;LEFT$(Z$,25-LEN(G2$));INT(D(R1)*100)*.01 2590 NEXT R1\PRINT\IF D0<>0 THEN 2480 2600 GOTO 730 2610 REM KLINGONS ARE SHOOTING 2620 IF K3<=0 THEN RETURN 2623 FOR I=S1-1 TO S1+1\FOR J=S1-1 TO S1+1 2624 IF INT(I+.5)<1 OR INT (I+.5)>8 OR INT(J+.5)<1 OR INT(J+.5)>8 THEN 2626 2625 A$=" B "\Z1=I\Z2=J\GOSUB 4050\IF Z3=1 THEN 2630 2626 NEXT J\NEXT I 2630 IF D0<>0 THEN PRINT "Starbase shields protect the Enterprise !"\RETURN 2640 FOR I=1 TO 4\IF K(I,3)<=0 THEN 2720 2650 H=INT((K(I,3)/FND(1))*(2+RND))\S=S-H\K(I,3)=K(I,3)-(H*.1) 2660 PRINT H;"Unit hit on the Enterprise from sector";K(I,1);",";K(I,2) 2670 IF S<=0 THEN 2750 2680 PRINT " "\IF H<20 THEN 2720 2690 IF RND>.6 OR H/S<=.03 THEN 2720 2700 R1=FNR(1)\D(R1)=D(R1)-H/S-.5*RND\GOSUB 3950\IF D(R1)=>0 THEN 2715 2710 PRINT "Damage control reports '";G2$;" damaged by the hit'"\GOTO 2720 2715 PRINT "Damage control reports '";G2$;" hit by klingon, but NOT damaged'" 2720 NEXT I\RETURN 2740 PRINT "It's Stardate";T\GOTO 2770 2750 PRINT\PRINT "The Enterprise has been destroyed. The Federation "; 2760 PRINT "will be conquered"\GOTO 2740 2770 PRINT "There were";K9;"Klingon battle cruisers left at" 2780 PRINT "the end of your mission." 2790 PRINT\PRINT\IF B9=0 THEN 2830 2800 PRINT "The Federation is in need of a new starship commander" 2805 REM ABOVE LINE SAID 'STARTSHIP' TYPO CORRECTED SEPT 30/2022 2810 PRINT "for a similar mission --- If there is a volunteer," 2820 ERASE G,C,K,N,Z,D\INPUT "let him enter 'YES'";A$\IF A$="YES" THEN 1 2825 REM --- COMMENT ADDED SEPT 29/2022 ---------------------------- END OF PAGE 5 2830 GOTO 4590 2840 PRINT "Congradulations, Captain! The last klingon battle cruiser" 2850 PRINT "menacing the federation has been destroyed."\PRINT 2860 PRINT "Your efficiency rating is\";1000*(K7/(T-T0))^2\GOTO 2790 2870 REM SHORT RANGE SENSOR SCAN &O0STARTUP SUBROUTINE 2880 FOR I=S1-1 TO S1+1\FOR J=S2-1 TO S2+1 2890 IF INT (I+.5)<1 OR INT(I+.5)>8 OR INT(J+.5)<1 OR INT(J+.5)>8 THEN 2910 2900 A$=" B "\Z1=I\Z2=J\GOSUB 4050\IF Z3=1 THEN 2920 2910 NEXT J\NEXT I\D0=0\GOTO 2940 2920 D0=1\C$="DOCKED"\E=30000\P=P0 2930 PRINT "Shields dropped for docking purposes"\S=0\GOTO 2960 2940 IF K3>0 THEN C$="*RED*"\GOTO 2960 2950 C$="GREEN"\IF E<(E0*.1) THEN C$="YELLOW" 2960 IF D(2)>=0 THEN 2980 2970 PRINT\PRINT "*** Short Range Sensors are out ***"\PRINT\RETURN 2980 O1$="---------------------------------"\PRINT O1$\FOR I=1 TO 8 2990 FOR J=(I-1)*24+1 TO (I-1)*24+22 STEP 3\PRINT " "; 3000 IF MID$(Q$,J,3)=" " THEN PRINT " "; ELSE PRINT MID$(Q$,J,3); 3010 NEXT J 3020 ON I GOTO 3030,3040,3050,3060,3070,3080,3090,3100 3030 PRINT " Stardate ";INT(T*10)*.1\GOTO 3120 3040 PRINT " Condition ";C$\GOTO 3120 3050 PRINT " Quadrant ";Q1;",";Q2\GOTO 3120 3060 PRINT " Sector ";S1;",";S2\GOTO 3120 3070 PRINT " Photon Torpedoes ";INT(P)\GOTO 3120 3080 PRINT " Total Energy ";INT(E+S)\GOTO 3120 3090 PRINT " Shields ";INT(S)\GOTO 3120 3100 PRINT " Klingongs Remaining";INT(K9) 3120 NEXT I\PRINT O1$\RETURN 3130 REM LIBRARY COMPUTER CODE 3135 REM ORIGINAL LINE WAS BLANK, DID NOT EXIST - ADDED SEPT 30/2022 3140 IF D(8)<0 THEN PRINT "Computer Disabled."\PRINT "(Spock beat it at Mastermind...)"\GOTO 730 3150 INPUT "Computer\ Working. What is your command";A 3170 IF A<0 THEN 730 3180 IF A>5 THEN A=6 3190 PRINT\H8=1\ON A+1 GOTO 3300,3430,3520,3820,3580,3280,3200 3200 PRINT "Functions available from library computer\" 3210 PRINT " 0 - Cumulative galactic record" 3220 PRINT " 1 - Status report" 3230 PRINT " 2 - Photo torpedo data" 3240 PRINT " 3 - Starbase navigation data" 3250 PRINT " 4 - Direction/Distance Calculator" 3260 PRINT " 5 - Galaxy 'Region Name' map"\PRINT\GOTO 3150 3270 REM SETUP TO CHANGE CUM GAL RECORD TO GALAXY MAP 3280 H8=0\G5=1\PRINT " The Galaxy"\GOTO 3330 3290 REM CUM GALACTIC RECORD 3300 PRINT\PRINT " "; 3310 PRINT "Computer Record of Galaxy for quadrant";Q1;",";Q2\PRINT 3330 PRINT " 1 2 3 4 5 6 7 8" 3340 O1$=" ----- ----- ----- ----- ----- ----- ----- -----" 3350 PRINT O1$\FOR I=1 TO 8\PRINT 8;\IF H8=0 THEN 3390 3360 FOR J=1 TO 8\PRINT " ";\IF Z(I,J)=0 THEN PRINT "***"'\GOTO 3380 3370 PRINT MID$(STR$(Z(I,J)+1000),3,3); 3380 NEXT J\GOTO 3410 3390 Z4=I\Z5=1\GOSUB 4100\J0=INT(15-.5*LEN(G2$))\PRINT TAB(J0);G2$; 3400 Z5=5\GOSUB 4100\J0=INT(39-.5*LEN(G2$))\PRINT TAB(J0);G2$; 3410 PRINT\PRINT 01$\NEXT I\PRINT\GOTO 730 3420 REM STATUS REPORT 3430 PRINT " Status Report\"\X$=""\IF K9>1 THEN X$="s" 3440 PRINT "Klingon";X$;" left\ ";K9 3450 PRINT "Mission must be completed in";.1*INT((T0+T9-T)*10);"stardates" 3460 X$="s"\IF B9<2 THEN X$=""\IF B9<1 THEN 3490 3465 REM --- COMMENT ADDED SEPT 29/2022 ---------------------------- END OF PAGE 6 3470 PRINT "The Federation is maintaining";B9;"starbase";X$;" in the galaxy" 3480 GOTO 2450 3490 PRINT "Your stupidity has left you on your own in" 3500 PRINT " the galaxy -- you hve no starbases left!!"\GOTO 2450 3510 REM TORPEDO, BASE NAV, D/D CALCULATOR 3520 IF K3<=0 THEN 1770 3530 X$=""\IF K3>1 THEN X$="s" 3540 PRINT "From Enterprise to Klingon battle cruiser";X$ 3550 H8=0\FOR I=1 TO 4\IF K(I,3)<=0 THEN 3810 3560 W1=K(I,1)\X=K(I,2) 3570 C1=S1\A=S2\GOTO 3620 3580 PRINT "Direction/Distance Calculator" 3590 PRINT "You are at quadrant";Q1;",";Q2;" sector";S1;",";S2 3600 PRINT "Please enter"\INPUT "Initial co-ordinates (X,Y)";C1,A 3610 INPUT " Final co-ordinates (X,Y)";W1,X 3620 X=X-A\A=C1-W1\IF X<0 THEN 3700 3630 IF A<0 THEN 3720 3640 IF X>0 THEN 3660 3650 IF A=0 THEN C1=5\GOTO 3670 3660 C1=1 3670 IF ABS(A)<=ABS(X) THEN 3690 3680 PRINT "Direction =";C1+(((ABS(A)-ABS(X))+ABS(A))/ABS(A))\GOTO 3770 3690 PRINT "Direction =";C1+(ABS(A)/ABS(X)+.00001)\GOTO 3770 3700 IF A>0 THEN C1=3\GOTO 3730 3710 IF X<>0 THEN C1=5\GOTO 3670 3720 C1=7 3730 IF ABS(A)>=ABS(X) THEN 3750 3740 PRINT "Direction =";C1+(((ABS(X)-ABS(A))+ABS(X))/ABS(X))\GOTO 3770 3750 PRINT "Direction =";C1+(ABS(X)/ABS(A)) 3770 LEO=SQR(X^2+A^2) 3780 IF W1=B4 THEN LEO=LEO/10 3790 PRINT "Distance = ";LEO 3800 IF H8=1 THEN 730 3810 NEXT I\GOTO 730 3820 IF B3<>0 THEN PRINT "From Enterprise to Starbase\"\W1=B4\X=B5\GOTO 3570 3830 PRINT "Spock: Sensors show no Starbases in this quadrant."\GOTO 730 3850 REM FIND AN EMPTY PLACE IN THE QUADRANT 3860 R1=FNR(1)\R2=FNR(1)\A$=" "\Z1=R1\Z2=R2\GOSUB 4050\IF Z3=0 THEN 3860 3870 RETURN 3880 REM INSERT IN STRING ARRAY FOR QUADRANT 3890 S8=INT(Z2-.5)*3+INT(Z1-.5)*24+1 3900 IF LEN(A$)<>3 THEN PRINT "***** Error ***** Invalid ship"\GOTO 4590 3910 IF S8=1 THEN Q$=A$+MID$(Q$,4,189)\RETURN 3920 IF S8=190 THEN Q$=LEFT$(Q$,189)+A$\RETURN 3930 Q$=LEFT$(Q$,S8-1)+A$+MID$(Q$,S8+3,190-S8)\RETURN 3940 REM PRINTS DEVICE NAME 3950 ON R1 GOTO 3960, 3970, 3980, 3990, 4000, 4010, 4020, 4030 3960 G2$="Warp Engines"\RETURN 3970 G2$="Short Range Sensors"\RETURN 3980 G2$="Long Range Sensors"\RETURN 3990 G2$="Phaser Control"\RETURN 4000 G2$="Photon Tubes"\RETURN 4010 G2$="Shield Control"\RETURN 4020 G2$="Damage Control"\RETURN 4030 G2$="Library-Computer"\RETURN 4040 REM STRING COMPARISON IN QUADRANT ARRAY 4050 Z1=INT(Z1+.5)\Z2=INT(Z2+.5)\S8=(Z2-1)*3+(Z1-1)*24+1\Z3=0 4060 IF MID$(Q$,S8,3)<>A$ THEN RETURN 4070 Z3=1\RETURN 4080 REM QUADRANT NAME IN G2$ FROM Z4,Z5=Q1,Q2 4090 REM CALL WITH G5=1 TO GET REGION NAME ONLY 4100 IF Z5<=4 THEN ON Z4 GOTO 4120,4130,4140,4150,4160,4170,4180,4190 4110 GOTO 4200 4115 REM --- COMMENT ADDED SEPT 29/2022 ---------------------------- END OF PAGE 7 4120 G2$="ANTARES"\GOTO 4290 4130 G2$="RIGEL"\GOTO 4290 4140 G2$="PROCYON"\GOTO 4290 4150 G2$="VEGA"\GOTO 4290 4160 G2$="CANOPUS"\GOTO 4290 4170 G2$="ALTAIR"\GOTO 4290 4180 G2$="SAGGITARIUS"\GOTO 4290 4190 G2$="POLLUX"\GOTO 4290 4200 ON Z4 GOTO 4210,4220,4230,4240,4250,4260,4270,4280 4210 G2$="SIRIUS"\GOTO 4290 4220 G2$="DENEB"\GOTO 4290 4230 G2$="CAPELLA"\GOTO 4290 4240 G2$="BETELGEUSE"\GOTO 4290 4245 REM AS OF THIS TIME SEPT 29/2022 THE STAR OF BETELGEUSE HAS NOVA'D :( 4250 G2$="ALDEBARAN"\GOTO 4290 4260 G2$="REGULUS"\GOTO 4290 4270 G2$="ARCTURUS"\GOTO 4290 4280 G2$="SPICA" 4290 IF G5<>1 THEN ON Z5 GOTO 4310,4320,4330,4340,4310,4320,4330,4340 4300 RETURN 4310 G2$=G2$+" I"\RETURN 4320 G2$=G2$+" II"\RETURN 4330 G2$=G2$+" III"\RETURN 4340 G2$=G2$+" IV"\RETURN 4350 PRINT "Spock: Excuse me Captain, but..." 4360 FOR I=1 TO 1000\NEXT I 4370 PRINT "Captain: Now now, Spock." 4380 FOR I=1 TO 3000\NEXT I 4390 PRINT "But Sir! The Starbase is returning fire..." 4400 PRINT "with everything they have!!!" 4410 FOR I=1 TO 2000\NEXT I 4420 PRINT "Half of the crew are escaping in our" 4430 PRINT "8 Shuttlecraft..."\FOR I=1 TO 1000\NEXT I 4440 PRINT "The crew salutes you, Captain ";GARB$; 4450 FOR I=1 TO 1000\NEXT I 4460 PRINT " (with their middle finger!)"\PRINT\PRINT 4470 FOR I=1 TO 7000\NEXT I\IF GARB$<>"" THEN I=LEN(GARB$)+1 ELSE I=LEN(GARB$) 4480 LOCATE 21,(31+I)\PRINT "Ooops I made a mistake how I said that" 4490 PRINT "The U.S.S. Enterprise is *VAPORIZED*" 4500 PRINT "and all who were left aboard, as well..."\GOTO 2800 4510 RESUME 4520 4520 PRINT "Stop fooling around. Please re-enter."\GOTO 840 4530 PRINT "But you'll kill the Repair Crew that's working" 4540 PRINT "inside the Photon Tubes!!(Photons broken, you know that)" 4550 RETURN 4560 RESUME 4570 4570 PRINT "Computer: I'm in no mood for such stupidity!!" 4580 GOTO 3150 4590 END