6580 LET D0=1 6590 LET C$="DOCKED" 6600 LET E=3000 6610 LET P=10 6620 PRINT "SHIELDS DROPPED FOR DOCKING PURPOSES" 6630 LET S=0 6640 GOTO 6720 6650 IF K3>0 THEN GOTO 6690 6660 IF E<E0+. 1 THEN GOTO 6710 6670 LET C$=" GREEN" 6680 GOTO 6720 6690 LET C$=" (7)*RED*(7)" 6700 GOTO 6720 6710 LET C$="YELLOW" 6720 IF D[2]>=0 THEN GOTO 6770 6730 PRINT 6740 PRINT "*** SHORT RANGE SENSORS ARE OUT ***" 6750 PRINT 6760 GOTO 7270 6770 LET 01$="----------------------------------------" 6780 PRINT 01$ 6790 DIM N5$[4] 6800 LET N5$="****" 6810 PRINT " "; 6820 FOR I=1 TO 22 STEP 3 6830 PRINT Q$[I,I+2]" "; 6840 NEXT I 6850 PRINT 6860 PRINT " "; 6870 FOR I=25 TO 46 STEP 3 6880 PRINT Q$[I,I+2]" "; 6890 NEXT I 6900 PRINT " STARDATE "; 6910 PRINT USING "****.*",T 6920 PRINT " "; 6930 FOR I=49 TO 70 STEP 3 6940 PRINT Q$[I,I+2]" "; 6950 NEXT I 6960 PRINT " CONDITION"; 6970 PRINT C$ 6980 PRINT " "; 6990 FOR I=1 TO 22 STEP 3 7000 PRINT R$[I,I+2]" "; 7010 NEXT I 7020 PRINT " QUADRANT "Q1","Q2 7030 PRINT " "; 7040 FOR I=25 TO 46 STEP 3 7050 PRINT R$[I,I+2]" "; 7060 NEXT I 7070 PRINT " SECTOR "S2","S2 7080 PRINT " "; 7090 FOR I=49 TO 70 STEP 3 7100 PRINT R$[I,I+2]" "; 7110 NEXT I 7120 PRINT " TOTAL ENERGY "; 7130 PRINT USING N5$,E+S 7140 PRINT " "; 7150 FOR I=1 TO 22 STEP 3 7160 PRINT S$[I,I+2]" "; 7170 NEXT I 7180 PRINT " PHOTON TORPEDOES"; 7190 PRINT USING N5$,P 7200 PRINT " "; 7210 FOR I=25 TO 46 STEP 3 7220 PRINT S$[I,I+2]" "; 7230 NEXT I 7240 PRINT " SHIELDS "; 7250 PRINT USING N5$,S 7260 PRINT 01$ 7270 RETURN 7280 REM *** LIBRARY COMPUTER CODE BEGINS HERE 7290 IF D[8]>-0 THEN GOTO 7320 7300 PRINT "COMPUTER DISABLED" 7310 GOTO 1990 7320 PRINT "COMPUTER ACTIVE AND AWAITING COMMAND:"; 7330 INPUT A 7340 IF A<0 THEN GOTO 1990 7350 PRINT 7360 LET H8=1 7370 IF A=0 THEN GOTO 7540 7380 ON A THEN GOTO 7900,8070,8500,8150,7400 7390 GOTO 7450 7400 REM *** SETUP TO CHANGE C.G. RECORD TO GALAXY MAP 7410 LET H8=0 7420 LET G5=1 7430 PRINT " THE GALAXY" 7440 GOTO 7550 7450 PRINT "FUNCTIONS AVAILABLE FROM LIBRARY-COMPUTER:" 7460 PRINT " 0 = CUMULATIVE GALACTIC RECORD" 7470 PRINT " 1 = STATUS REPORT" 7480 PRINT " 2 = PHOTON TORPEDO DATA" 7490 PRINT " 3 = STARBASE NAV DATA" 7500 PRINT " 4 = DIRECTION/DISTANCE CALCULATOR" 7510 PRINT " 5 = GALAXY 'REGION NAME' MAP" 7520 GOTO 7320 7530 REM *** CUM GALACTIC RECORD CODE BEGINS *** 7540 PRINT " COMPUTER RECORD OF GALAXY FOR QUADRANT "Q1,", "Q2":" 7550 PRINT " 1 2 3 4 5 6 7 8" 7560 LET 03$=" ----- ----- ----- ----- ----- ----- ----- -----" 7570 PRINT 03$ 7580 DIM N1$[2],N2$[8],N$[5] 7590 FOR I=1 TO 8 7600 LET N1@="*" 7610 PRINT USING N1$,I; 7620 IF H8=0 THEN GOTO 7740 7630 FOR J=1 TO 8 7640 LET N2$=" ***" 7650 LET N$=" " 7660 IF I<>Q1 THEN GOTO 7700 7670 IF J<>Q2 THEN GOTO 7700 7680 LET N$="(7) 7690 PRINT N$; 7700 PRINT USING N2$,Z[I,J]; 7710 PRINT N$; 7720 NEXT J 7730 GOTO 7850 7740 LET Z4=I 7750 LET Z5=1 7760 GOSUB 9030 7770 LET J0=INT(15-. 5+LEN(G2$)) 7780 PRINT TAB(J0); 7790 PRINT G2$ 7800 LET Z5=5 7810 GOSUB 9030 7820 LET J0=INT(39-.5+LEN(G2$)) 7830 PRINT TAB(J0); 7840 PRINT G2$; 7850 PRINT 7860 PRINT 03$ 7870 NEXT I 7880 GOTO 1990 7890 REM *** STATUS REPORT CODE BEGINS HERE *** 7900 PRINT " STATUS REPORT:" 7910 LET X$="" 7920 IF K9=1 THEN GOTO 7940 7930 LET X$="S" 7940 PRINT K9" KLINGON"X$" LEFT" 7950 LET V5=(T0+T9)-T 7960 PRINT USING "MISSION MUST BE COMPLETED IN **.* STARDATES", V5 7970 LET X$="" 7980 IF B9=1 THEN GOTO 8040 7990 LET X$="S" 8000 IF B9<>0 THEN GOTO 8040 8010 PRINT "YOUR STUPIDITY HAS LEFT YOU ON YOUR OWN IN" 8020 PRINT " THE GALAXY -- YOU HAVE NO STARBASES LEFT!" 8030 GOTO 5690 8040 PRINT " THE FEDERATION IS MAINTAINING"B9" STARBASES"X$ IN THE GALAXY" 8050 GOTO 5690 8060 REM CODE FOR TORPEDO DATA, BASE NAV, D/D CALCULATOR *** 8070 LET H8=0 8080 FOR I=1 TO 3 8090 IF K[I,3]<=0 THEN GOTO 8480 8100 LET W1=K[I,1] 8110 LET X=K[I,2] 8120 LET C1=S1 8130 LET A=S2 8140 GOTO 8220 8150 PRINT " DIRECTION/DISTANCE CALCULATOR:" 8160 PRINT "YOU ARE AT QUADRANT ("Q1","Q2") SECTOR ("S1","S2")" 8170 PRINT " PLEASE ENTER --" 8180 PRINT " INITIAL COORDINATES (X,Y)"; 8190 INPUT C1,A 8200 PRINT " FINAL COORDINATES (X,Y)"; 8210 INPUT W1,X 8220 LET X=X-A 8230 LET A=C1-W1 8240 IF X<0 THEN GOTO 8350 8250 IF A<0 THEN GOTO 8410 8260 IF X>0 THEN GOTO 8280 8270 IF A=0 THEN GOTO 8370 8280 LET C1=1 8290 IF ABS(A)<=ABS(X) THEN GOTO 8330 8300 LET V5=C1+((ABS(A)-ABS(X))+ABS(A))/ABS(A)) 8310 PRINT " DIRECTION ="V5" 8320 GOTO 8460 8330 PRINT " DIRECTION ="C1+(ABS(A)/ABS(X)) 8340 GOTO 8460 8350 IF A>0 THEN GOTO 8390 8360 IF X=0 THEN GOTO 8410 8370 LET C1=5 8380 GOTO 8290 8390 LET C1=3 8400 GOTO 8420 8410 LET C1=7 8420 IF ABS(A))=ABS(X THEN GOTO 8450 8430 PRINT " DIRECTION ="C1+(((ABS(X)-ABS(X))/ABS(x)) 8440 GOTO 8460 8450 PRINT "DIRECTION ="C1+ABS(X)/ABS(A)) 8460 PRINT "DISTANCE ="SQR(x^2+A^2) 8470 IF H8=1 THEN GOTO 1990 8480 NEXT I 8490 GOTO 1990 8500 IF B3<>0 THEN GOTO 8530 8510 PRINT "MR. SPOCK REPORTS, 'SENSORS SHOW NO STARBASES IN THIS QUADRANT.'" 8520 GOTO 1990 8530 PRINT "FROM ENTERPRISE TO STARBASE:" 8540 LET W1=B4 8550 LET X=B5 8560 GOTO 8120 8570 REM *** END OF LIBRARY-COMPUTER CODE 8580 REM S/R FINDS RANDOM HOLE IN QUADRANT 8590 LET R1=INT(RND(1)*8+1) 8600 LET R2=INT(RND(1)*8+1) 8610 LET A$=" " 8620 LET Z1=R1 8630 LET Z2=R2 8640 GOSUB 8830 8650 IF Z3=0 THEN GOTO 8590 8660 RETURN 8670 REM *** INSERTION IN STRING ARRAY FOR QUADRANT *** 8680 LET S8=INT(Z1+.5)/24+INT(Z2+.5)*3-26 8690 LET S8>72 THEN GOTO 8720 8700 LET Q$(S8,S8+2)=A$ 8710 GOTO 8780 8720 IF S8>144 THEN GOTO 8760 8730 LET S8=S8-752 8740 LET R$[S8,S8+2]=A$ 8750 GOTO 8780 8760 LET S8=S8-144 8770 LET S$[S8,S8+2]=A$ 8780 RETURN 8790 REM *** PRINTS DEVICE NAME FROM ARRAY *** 8800 LET S8=R1*12-11 8810 PRINT D$[S8,S8+11], 8820 RETURN 8830 REM *** STRING COMPARISON IN QUADRANT ARRAY *** 8840 LET Z1=INT(Z1+.5) 8850 LET Z2=INT(Z2+.5) 8860 LET S8=Z1*Z4+Z2+*3-26 8870 LET Z3=0 8880 IF S8>72 THEN GOTO 8920 8890 IF Q$[S8,S8+2]<>A$ THEN GOTO 9000 8900 LET Z3=1 8910 GOTO 9000 8920 IF S8>144 THEN GOTO 8970 8930 LET S8=S8-72 8940 IF R%[S8,S8+2<>A$ THEN GOTO 9000 8950 LET Z3=1 8960 GOTO 9000 8970 LET S8=S8-144 8980 IF S$[S8,S8+2]<>A$ THEN GOTO 9000 8990 LET Z3=1 9000 RETURN 9010 REM ** S/R PRODUCES QUADRANT NAME IN G2$ FROM Z4,Z5(=Q1,Q2) 9020 REM ** (CALL WITH G5=1 TO GET REGION NAME ONLY) 9030 LET L2=2 9040 LET Z5>=5 THEN GOTO 9060 9050 LET L2=1 9060 LET L3=2*(Z4-1)+L2 9070 LET I3=1 9080 LET I0=1 9090 FOR L=1 TO LEN(G1$) 9100 IF G1$[L,L]<>"." THEN GOTO 9140 9110 IF I3=L3 THEN GOTO 9150 9120 LET I0=L+1 9130 LET I3=I3+1 9140 NEXT L 9150 LET G2$=G1$[I0,L-1] 9160 IF G5=1 THEN GOTO 9240 9170 LET L3=Z5 9180 IF Z5<=4 THEN GOTO 9200 9190 LET L3=Z5-4 9200 LET G3$="IV" 9210 IF L3=4 THEN GOTO 9230 9220 LET G3$=G4$[1, L3] 9230 LET G2$=G2$," ",G3$ 9240 RETURN 9250 STOP 9260 END