10 REM INSTRUCTIONS FOR "STARTREK"
15 CLS:KEY OFF
20 FOR I=1 TO 8:PRINT:NEXT I
30 PRINT TAB(20);"*************************************
40 PRINT TAB(20);"*                                   *
50 PRINT TAB(20);"*                                   *
60 PRINT TAB(20);"*      * * SUPER STAR TREK * *      *
70 PRINT TAB(20);"*                                   *
80 PRINT TAB(20);"*                                   *
90 PRINT TAB(20);"*************************************
95 PRINT "                    PLEASE SHIFT KEYBOARD TO UPPER CASE.":PRINT
100 INPUT "                     DO YOU NEED INSTRUCTIONS (Y/N)";K$
101 IF K$="N" THEN 1170
105 CLS
110 PRINT"     INSTRUCTIONS FOR SUPER STAR TREK"
120 PRINT
130 PRINT"1. WHEN YOU SEE \COMMAND ?\ PRINTED, ENTER ONE OF THE LEGAL"
140 PRINT"   COMMANDS (NAV,SRS,LRS,PHA,TOR,SHE,DAM,COM, OR XXX)."
150 PRINT
160 PRINT"2. IF YOU SHOULD TYPE IN AN ILLEGAL COMMAND, YOU'LL GET A SHORT"
170 PRINT"   LIST OF THE LEGAL COMMANDS PRINTED OUT."
175 PRINT
180 PRINT"3. SOME COMMANDS REQUIRE YOU TO ENTER DATA (FOR EXAMPLE, THE `NAV'"
190 PRINT"   COMMAND COMES BACK WITH `COURSE (1-9) ?').  IF YOU TYPE IN"
200 PRINT"   ILLEGAL DATA (LIKE NEGATIVE NUMBERS), THAT COMMAND WILL BE"
210 PRINT"   ABORTED."
220 PRINT
230 PRINT"4. THE GALAXY IS DIVIDED INTO AN 8 X 8 QUADRANT GRID, AND EACH"
240 PRINT"   QUADRANT IS FURTHER DIVIDED INTO AN 8 X 8 SECTOR GRID."
250 PRINT
260 PRINT"5. YOU WILL BE ASSIGNED A STARTING POINT SOMEWHERE IN THE GALAXY"
270 PRINT"   TO BEGIN A TOUR OF DUTY AS COMMANDER OF THE STARSHIP"
280 PRINT"   \ENTERPRISE\; YOUR MISSION: TO SEEK AND DESTROY THE FLEET OF"
290 PRINT"   KLINGON WARSHIPS WHICH ARE MENACING THE UNITED FEDERATION OF"
300 PRINT"   PLANETS."
310 PRINT:PRINT
320 INPUT"PRESS ENTER TO CONTINUE",O
330 CLS
340 PRINT"6. YOU HAVE THE FOLLOWING COMMANDS AVAILABLE TO YOU AS CAPTAIN"
350 PRINT"   OF THE STARSHIP ENTERPRISE:"
360 PRINT
370 PRINT"   \NAV\ = WARP ENGINE CONTROL --"
380 PRINT"         COURSE IS IN A CIRCULAR NUMERICAL       4  3  2"
390 PRINT"         VECTOR ARRANGEMENT AS SHOWN.             . . ."
400 PRINT"         INTEGER AND REAL VALUES MAY BE            ..."
410 PRINT"         USED.  THUS COURSE 1.5 IS HALFWAY     5 -- * -- 1"
420 PRINT"         BETWEEN 1 AND 2.                          ..."
430 PRINT"                                                  . . ."
440 PRINT"         VALUES MAY APPROACH 9.0, WHICH          6  7  8"
450 PRINT"         ITSELF IS EQUIVALENT TO 1.0."
460 PRINT"                                                 COURSE"
470 PRINT"         ONE WARP FACTOR IS THE SIZE OF"
480 PRINT"         ONE QUADRANT.  THEREFORE, TO GET"
490 PRINT"         FROM QUADRANT 6,5 TO 5,5 YOU WOULD"
500 PRINT"         USE COURSE 3, WARP FACTOR 1."
510 PRINT:PRINT:PRINT
520 INPUT"PRESS ENTER TO CONTINUE",O
530 CLS
540 PRINT"   \SRS\ = SHORT RANGE SENSOR SCAN.  IT SHOWS YOU A SCAN OF YOUR"
550 PRINT"         PRESENT QUADRANT.  SENSOR SCREEN SYMBOLOGY IS AS FOLLOWS:"
560 PRINT"          = YOUR STARSHIP'S POSITION"
570 PRINT"         +K+ = KLINGON BATTLE CRUISER"
580 PRINT"         >B< = FEDERATION STARBASE (REFUEL/REPAIR/RE-ARM HERE!)"
590 PRINT"          *  = STAR"
600 PRINT
610 PRINT"         A CONDENSED `STATUS REPORT' WILL ALSO BE PRESENTED."
620 PRINT
630 PRINT"   \LRS\ = LONG RANGE SENSOR SCAN.  THIS SHOWS CONDITIONS IN SPACE"
640 PRINT"         FOR ONE QUADRANT ON EACH SIDE OF THE ENTERPRISE (WHICH IS"
650 PRINT"         IN THE MIDDLE OF THE SCAN).  THE SCAN IS CODED IN THE FORM"
660 PRINT"         `###', WHERE THE UNITS DIGIT IS THE NUMBER OF STARS, THE"
670 PRINT"         TENS DIGIT IS THE NUMBER OF STARBASES, AND THE HUNDREDS"
680 PRINT"         DIGIT IS THE NUMBER OF KLINGONS."
690 PRINT
700 PRINT"         EXAMPLE:  207 = 2 KLINGONS, NO STARBASES, AND 7 STARS."
710 PRINT
720 PRINT"   \PHA\ = PHASER CONTROL.  IT ALLOWS YOU TO DESTROY THE KLINGON"
730 PRINT"         BATTLE CRUISERS BY ZAPPING THEM WITH SUITABLY LARGE UNITS"
740 PRINT"         OF ENERGY TO DEPLETE THEIR SHIELD POWER.  (REMBER, KLINGONS"
750 PRINT"         HAVE PHASERS TOO!"
760 PRINT
770 INPUT"PRESS ENTER TO CONTINUE",O
780 CLS
790 PRINT"   \TOR\ = PHOTON TORPEDO CONTROL.  TORPEDO COURSE IS THE SAME AS"
800 PRINT"         USED IN WARP ENFINE CONTROL.  IF YOU HIT THE KLINGON VESSEL"
810 PRINT"         HE IS DESTROYED AND CANNOT FIRE BACK.  IF YOU MISS, YOU ARE"
820 PRINT"         SUBJECT TO HIS PHASER FIRE.  IN EITHER CASE, YOU ARE ALSO"
830 PRINT"         SUBJECT TO THE PHASER FIRE OF ALL OTHER KLINGONS IN THE"
840 PRINT"         QUADRANT.  THE LIBRARY-COMPUTER (\COM\ COMMAND) HAS AN"
850 PRINT"         OPTION TO COMPUTE TORPEDO TRAJECTORY FOR YOU (OPTION 2)."
860 PRINT
870 PRINT"   \SHE\ = SHIELD CONTROL.  THIS DEFINES THE NUMBER OF ENERGY UNITS"
880 PRINT"         TO BE ASSIGNED TO THE SHIELDS.  ENERGY IS TAKEN FROM TOTAL"
890 PRINT"         SHIP'S ENERGY.  NOTE THAT THE STATUS DISPLAY `TOTAL ENERGY'"
900 PRINT"         INCLUDES SHIELD ENERGY."
910 PRINT
920 PRINT"   \DAM\ = DAMAGE CONTROL REPORT.  IT GIVES THE STATE OF REPAIR OF"
930 PRINT"         ALL DEVICES.  WHERE A NEGATIVE `STATE OF REPAIR' SHOWS THAT"
940 PRINT"         THE DEVICE IS TEMPORARILY DAMAGED.
950 PRINT:PRINT:PRINT:PRINT:PRINT
960 INPUT"PRESS ENTER TO CONTINUE",O
970 CLS
980 PRINT"   \COM\ = LIBRARY-COMPUTER.  IT CONTAINS SIX OPTIONS:"
990 PRINT"         OPTION 0 = CUMULATIVE GALACTIC RECORD, WHICH SHOWS COMPUTER"
1000 PRINT"                  MEMORY OF THE RESULTS OF ALL PREVIOUS SHORT AND"
1010 PRINT"                  LONG RANGE SENSOR SCANS."
1020 PRINT"         OPTION 1 = STATUS REPORT.  IT SHOWS THE NUMBER OF KLINGONS,"
1030 PRINT"                  STARDATES, AND STARBASES REMAINING IN THE GAME."
1040 PRINT"         OPTION 2 = PHOTON TORPEDO DATA, WHICH GIVES DIRECTIONS AND"
1050 PRINT"                  DISTANCE FROM THE ENTERPRISE TO ALL KLINGONS IN"
1060 PRINT"                  YOUR QUADRANT."
1070 PRINT"         OPTION 3 = STARBASE NAV DATA.  THIS TELLS DIRECTION AND"
1080 PRINT"                  DISTANCE TO ANY STARBASE WITHIN YOUR QUADRANT."
1090 PRINT"         OPTION 4 = DIRECTION/DISTANCE CALCULATOR.  IT ALLOWS YOU"
1100 PRINT"                  TO ENTER COORDINATES FOR DIRECTION/DISTANCE"
1110 PRINT"                  CALCULATIONS."
1120 PRINT"         OPTION 5 = GALACTIC `REGION NAME' MAP, WHICH PRINTS THE"
1130 PRINT"                  NAMES OF THE SIXTEEN MAJOR GALACTIC REGIONS"
1140 PRINT"                  REFERRED TO IN THE GAME."
1150 PRINT:PRINT:PRINT"END OF INSTRUCTIONS
1160 INPUT"DO YOU WISH TO SEE THEM AGAIN (Y/N)";K$
1165 IF K$="Y" OR K$="YES" THEN 105
1170 CLS
1180 REM *  *  *  *    RANDOMIZE RND FUNCTION    *  *  *  *
1190 CLEAR ,,2000
1200 CLOCK$=TIME$
1202 SEED$=MID$(CLOCK$,4,2)+MID$(CLOCK$,7,2)
1204 RANDOMIZE VAL(SEED$)
1230 CLS
1232 A$="MBL2N30N40.L8N39L4N37L8N35N34L2N33."
1234 PLAY A$
1236 B$="MBL4N31L2N30N42.L8N40L4N39L8N37N35L2N34."
1238 PLAY B$
1239 KEY OFF:COLOR 0,7
1250 PRINT "                                      .------^------,                          "
1260 PRINT "                    .---------------,  '---, ,-----'                           "
1270 PRINT "                    '----------, ,-'     / /                                   "
1280 PRINT "                          ,---' `-----------,                                  "
1290 PRINT "                           `-------------------'                               "
1295 COLOR 16,7
1300 PRINT "                THE STARSHIP   USS ENTERPRISE --- NCC-1701                     "
1310 COLOR 7,0
1320 Z$="                         "
1330 DIM G(8,8),C(9,2),K(3,3),N(3),Z(8,8),D(8)
1340 T=INT(RND(1)*20+20)*100:T0=T:T9=25+INT(RND(1)*10):D0=0:E=3000:E0=E
1350 P=10:P0=P:S9=200:S=0:B9=0:K9=0:X$="":X0$=" IS "
1351 DEF FND(D)=SQR((K(I,1)-S1)^2+(K(I,2)-S2)^2)
1352 DEF FNR(R)=INT(RND(R)*7.98+1.01)
1355 REM **********  SET FUNCTION KEYS  **********
1356 KEY 1,  "NAV"+CHR$(13)
1357 KEY 2,  "SRS"+CHR$(13)
1358 KEY 3,  "LRS"+CHR$(13)
1359 KEY 4,  "PHA"+CHR$(13)
1360 KEY 5,  "TOR"+CHR$(13)
1361 KEY 6,  "SHE"+CHR$(13)
1362 KEY 7,  "DAM"+CHR$(13)
1363 KEY 8,  "COM"+CHR$(13)
1364 KEY 9,  "HLP"+CHR$(13)
1365 KEY 10, "XXX"+CHR$(13)
1370 KEY ON
1380 REM **********  INITIALIZE ENTERPRISE'S POSITION  **********
1390 Q1=FNR(1):Q2=FNR(1):S1=FNR(1):S2=FNR(1):WIND=RND(1)
1395 IF WIND>.2 THEN WIND=0
1400 FOR I=1 TO 9:C(I,1)=0:C(I,2)=0:NEXT I
1410 C(3,1)=-1:C(2,1)=-.72:C(4,1)=-.72:C(4,2)=-.72:C(5,2)=-1:C(6,2)=-.72
1420 C(1,2)=1:C(2,2)=.72:C(6,1)=.72:C(7,1)=1:C(8,1)=.72:C(8,2)=.72:C(9,2)=1
1430 FOR I=1 TO 8:D(I)=0:NEXT I
1440 A1$="NAVSRSLRSPHATORSHEDAMCOMXXX"
1450 REM * * * * * *  SET UP WHAT EXISTS IN GALAXY  * * * * * *
1460 REM * * *  K3=# KLINGONS, B3=# STARBASES, S3=# STARS   * *
1470 FOR I=1 TO 8:FOR J=1 TO 8:K3=0:Z(I,J)=0:R1=RND(1)
1480 IF R1>.9799999 THEN K3=3:K9=K9+3:GOTO 1510
1490 IF R1>.95 THEN K3=2:K9=K9+2:GOTO 1510
1500 IF R1>.8 THEN K3=1:K9=K9+1
1510 B3=0:IF RND(1)>.96 THEN B3=1:B9=B9+1
1520 G(I,J)=K3*100+B3*10+FNR(1):NEXT J:NEXT I:IF K9>T9 THEN T9=K9+1
1530 IF B9<>0 THEN 1560
1540 IF G(Q1,Q2)<200 THEN G(Q1,Q2)=G(Q1,Q2)+100:K9=K9+1
1550 B9=1:G(Q1,Q2)=G(Q1,Q2)+10:Q1=FNR(1):Q2=FNR(1)
1560 K7=K9:IF B9<>1 THEN X$="S":X0$=" ARE "
1570 PRINT"   YOUR ORDERS ARE AS FOLLOWS:":PRINT
1580 PRINT"   DESTROY THE";K9;"KLINGON WARSHIPS WHICH HAVE INVADED THE"
1590 PRINT"   GALAXY BEFORE THEY CAN ATTACK FEDERATION HEADQUARTERS"
1600 PRINT"   ON STARDATE";T0+T9;".  THIS GIVES YOU";T9;"DAYS.  THERE";X0$
1610 PRINT"  "B9;"STARBASE"X$" IN THE GALAXY FOR RESUPPLYING YOUR SHIP."
1620 PRINT:PRINT
1630 INPUT "Hit RETURN KEY when ready to accept command.",K12
1631 FOR U=1 TO 300: NEXT U
1632 CLS
1633 I=RND(1):IF INP(1)=13 THEN 1633
1640 REM  * * * * *   HERE ANY TIME NEW QUADRANT ENTERED   * * * * *
1650 Z4=Q1:Z5=Q2:K3=0:B3=0:S3=0:G5=0:D4=.5*RND(1):Z(Q1,Q2)=G(Q1,Q2)
1660 IF Q1<1 OR Q1>8 OR Q2<1 OR Q2>8 THEN 1760
1670 GOSUB 11000:PRINT:PRINT:IF T0<>T THEN 1700
1680 PRINT"YOUR MISSION BEGINS WITH YOUR STARSHIP LOCATED IN THE GALACTIC"
1690 PRINT"QUADRANT, `";G2$;"'.":M$=INPUT$(1):GOTO 1710
1700 PRINT"NOW ENTERING ";G2$;" QUADRANT . . ."
1710 PRINT:K3=INT(G(Q1,Q2)*.01):B3=INT(G(Q1,Q2)*.1)-10*K3
1720 S3=G(Q1,Q2)-100*K3-10*B3:IF K3=0 THEN 1750
1725 FOR I=1 TO 20:PLAY "MBL16N10N30":NEXT I
1730 PRINT"COMBAT AREA      CONDITION RED"
1732 DEF SEG=&HB000:FOR RT=1 TO 61 STEP 2
1734 POKE 3520+RT,&H8F:NEXT RT:DEF SEG
1736 IF S>200 THEN 1750
1740 PRINT"   SHIELDS DANGEROUSLY LOW"
1750 FOR I=1 TO 3:K(I,1)=0:K(I,2)=0:NEXT I
1760 FOR I=1 TO 3:K(I,3)=0:NEXT I:Q$=Z$+Z$+Z$+Z$+Z$+Z$+Z$+LEFT$(Z$,17)
1770 REM  * *  POSITION ENTERPRISE IN QUADRANT, THEN PLACE "K3" KLINGONS,  * *
1780 REM  * *  "B3" STARBASES, AND "S3" STARS ELSEWHERE.                   * *
1790 A$="":Z1=S1:Z2=S2:GOSUB 10780:IF K3<1 THEN 1820
1800 FOR I=1 TO K3:GOSUB 10750:A$="+K+":Z1=R1:Z2=R2
1810 GOSUB 10780:K(I,1)=R1:K(I,2)=R2:K(I,3)=S9*(.5*RND(1)):NEXT I
1820 IF B3<1 THEN 1840
1830 GOSUB 10750:A$=">B<":Z1=R1:B4=R1:Z2=R2:B5=R2:GOSUB 10780
1840 FOR I=1 TO S3:GOSUB 10750:A$=" * ":Z1=R1:Z2=R2:GOSUB 10780:NEXT I
1850 GOSUB 6000
1860 IF S+E>10 THEN IF E>10 OR D(7)>=0 THEN 1910
1870 PRINT:PRINT"** FATAL ERROR **   YOU'VE JUST STRANDED YOUR SHIP IN SPACE"
1880 PRINT"YOU HAVE INSUFFICIENT MANEUVERING ENERGY,";
1890 PRINT" AND SHIELD CONTROL":PRINT"IS PRESENTLY INCAPABLE OF CROSS";
1900 PRINT"-CIRCUITING TO ENGINE ROOM!!":GOTO 5860
1910 INPUT"  COMMAND?";A$
1920 FOR I=1 TO 9:IF LEFT$(A$,3)<>MID$(A1$,3*I-2,3) THEN 1940
1930 ON I GOTO 2500,1850,4000,4090,4700,5500,5600,6500,5890
1940 NEXT I:PRINT"   ENTER ONE OF THE FOLLOWING:"
1950 PRINT"     NAV  (TO SET COURSE)"
1960 PRINT"     SRS  (FOR SHORT RANGE SENSOR SCAN)"
1970 PRINT"     LRS  (FOR LONG RANGE SENSOR SCAN)"
1980 PRINT"     PHA  (TO FIRE PHASERS)"
1990 PRINT"     TOR  (TO FIRE PHOTON TORPEDOES)"
2000 PRINT"     SHE  (TO RAISE OR LOWER SHIELDS)"
2010 PRINT"     DAM  (FOR DAMAGE CONTROL REPORTS)"
2020 PRINT"     COM  (TO CALL ON LIBRARY-COMPUTER)"
2030 PRINT"     XXX  (TO RESIGN YOUR COMMAND)":PRINT:GOTO 1860
2040 REM *  *  *  *  COURSE CONTROL BEGINS HERE  *  *  *  *
2500 INPUT"COURSE (1-9)";C1:IF C1=9 THEN C1=1
2510 IF C1>=1 AND C1<9 THEN 2530
2520 PRINT"   LT. SULU REPORTS, `INCORRECT COURSE DATA, SIR!'":GOTO 1860
2530 X$="8":IF D(1)<0 THEN X$="0.2"
2540 PRINT"WARP FACTOR (0-";X$;")";:INPUT W1:IF D(1)<0 AND W1>.2 THEN 2590
2545 FOR U=1 TO 100:NEXT U:CLS:GOSUB 12500
2550 IF W1>0 AND W1<=8 THEN 2600
2560 IF W1=0 THEN 1860
2570 PRINT"   CHIEF ENGINEER SCOTT REPORTS, `THE ENGINES WON'T TAKE";
2580 PRINT" WARP ";W1;"!'":GOTO 1860
2590 PRINT"WARP ENGINES ARE DAMAGED.  MAXIUM SPEED = WARP 0.2":GOTO 1860
2600 N=INT(W1*8+.5):IF E-N>=0 THEN 2810
2610 PRINT"ENGINEERING REPORTS   `INSUFFICIENT ENERGY AVAILABLE"
2620 PRINT"                       FOR MANEUVERING AT WARP";W1;"!'"
2630 IF S=1 THEN D6=1
2850 FOR I=1 TO 8:IF D(I)>=0 THEN 2910
2860 D(I)=D(I)+D6:IF D(I)>-.1 AND D(I)<0 THEN D(I)=-.1:GOTO 2910
2880 IF D(I)<0 THEN 2910
2890 IF D1<>1 THEN D1=1:PRINT"DAMAGE CONTROL REPORT:  ";
2900 PRINT TAB(8);:R1=I:GOSUB 10840:PRINT G2$;" REPAIR COMPLETED."
2910 NEXT I:IF RND(1)>.2 THEN 2980
2920 R1=FNR(1):IF RND(1)>=.6 THEN 2950
2930 D(R1)=D(R1)-(RND(1)*5+1):PRINT"DAMAGE CONTROL REPORT:  ";
2940 GOSUB 10840:PRINT G2$;" DAMAGED":PRINT:GOTO 2980
2950 D(R1)=D(R1)+RND(1)*3+1:PRINT"DAMAGE CONTROL REPORT:  ";
2960 GOSUB 10840:PRINT G2$;" STATE OF REPAIR IMPROVED":PRINT
2970 REM *  *  *  *  *  BEGIN MOVING STARSHIP  *  *  *  *  *
2980 S1=S1+.5:S2=S2+.5
2982 A$="   ":Z1=INT(S1):Z2=INT(S2):GOSUB 10780
2985 WIND=RND(1):IF WIND>.3 THEN WIND=0
2990 X1=-SIN((C1-1)*.7853982):X=S1:Y=S2
3000 X2=COS((C1-1)*.7853981):Q4=Q1:Q5=Q2
3010 FOR I=1 TO N:S1=S1+X1:S2=S2+X2
3011 IF S1<1 OR S1>=9 OR S2<1 OR S2>=9 THEN 3100
3013 S8=INT(S1)*24+INT(S2)*3-26:IF MID$(Q$,S8,2)="  " THEN 3030
3016 S1=INT(S1-X1):S2=INT(S2-X2):PRINT"WARP ENGINES SHUT DOWN AT ";
3020 PRINT"SECTOR";S1;",";S2;"DUE TO BAD NAVAGATION":GOTO 3040
3030 NEXT I:S1=INT(S1):S2=INT(S2)
3040 A$="":Z1=INT(S1):Z2=INT(S2):GOSUB 10780:GOSUB 3270:T8=1:GOSUB 12000
3050 IF W1<1 THEN T8=.1*INT(10*W1)
3060 T=T+T8:IF T>T0+T9 THEN 5860
3070 REM *  *  *  *  SEE IF DOCKED, THEN GET COMMAND  *  *  *  *
3080 GOTO 1850
3090 REM *  *  *  *  *  EXCEEDED QUADRANT LIMITS  *  *  *  *  *
3100 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)
3110 S2=INT(Y-Q2*8):IF S1=0 THEN Q1=Q1-1:S1=8
3120 IF S2=0 THEN Q2=Q2-1:S2=8
3130 X5=0:IF Q1<1 THEN X5=1:Q1=1:S1=1
3140 IF Q1>8 THEN X5=1:Q1=8:S1=8
3150 IF Q2<1 THEN X5=1:Q2=1:S2=1
3160 IF Q2>8 THEN X5=1:Q2=8:S2=8
3170 IF X5=0 THEN 3240
3180 PRINT"LT. UHURA REPORTS MESSAGE FROM STARFLEET COMMAND:"
3190 PRINT"  `PERMISSION TO ATTEMPT CROSSING OF GALACTIC PERIMETER"
3200 PRINT"  IS HEREBY *DENIED*.  SHUT DOWN YOUR ENGINES.'":GOSUB 12000
3210 PRINT"CHIEF ENGINEER SCOTT REPORTS  `WARP ENGINES SHUT DOWN"
3220 PRINT"  AT SECTOR";S1;",";S2;"OF QUADRANT";Q1;",";Q2;".'":GOSUB 12000
3230 IF T>T0+T9 THEN 5860
3240 IF 8*Q1+Q2=8*Q4+Q5 THEN 3060
3250 T=T+1:GOSUB 3270:GOSUB 1650
3260 REM *  *  *  *  *  *  MANEUVER ENERGY S/R  *  *  *  *  *  *
3270 E=E-N-10:IF E>=0 THEN RETURN
3280 PRINT"SHIELD CONTROL SUPPLIES ENERGY TO COMPLETE THE MANEUVER."
3290 S=S+E:E=0:IF S<=0 THEN S=0
3300 RETURN
3990 REM *  *  *  *  *  LONG RANGE SENSOR SCAN CODE  *  *  *  *  *
4000 IF D(3)<0 THEN PRINT"LONG RANGE SENSORS ARE INOPERABLE":GOTO 1860
4010 PRINT"LONG RANGE SCAN FOR QUADRANT";Q1;",";Q2
4020 O1$="-------------------":PRINT O1$
4030 FOR I=Q1-1 TO Q1+1:N(1)=-1:N(2)=-2:N(3)=-3:FOR J=Q2-1 TO Q2+1
4040 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)
4050 NEXT J:FOR L=1 TO 3:PRINT": ";:IF N(L)<0 THEN PRINT"*** ";:GOTO 4070
4060 PRINT RIGHT$(STR$(N(L)+1000),3);" ";
4070 NEXT L:PRINT":":PRINT O1$:NEXT I:GOTO 1860
4080 REM *  *  *  *  *  PHASER CONTROL CODE BEGINS HERE  *  *  *  *  *
4090 IF D(4)<0 THEN PRINT"PHASERS INOPERATIVE":GOTO 1860
4100 IF K3>0 THEN GOTO 4130
4110 PRINT"SCIENCE OFFICER SPOCK REPORTS  `SENSORS SHOW NO ENEMY SHIPS"
4120 PRINT"                                IN THIS QUADRANT'":GOTO 1860
4130 IF D(8)<0 THEN PRINT"COMPUTER FAILURE HAMPERS ACCURACY"
4140 PRINT"PHASERS LOCKED ON TARGET;  ";
4150 PRINT"ENERGY AVAILABLE =";E;"UNITS"
4160 INPUT"NUMBER OF UNITS TO FIRE";X:IF X<=0 THEN 1860
4170 IF E-X<0 THEN 4150
4172 PLAY "MBN1......"
4180 E=E-X:IF D(7)<0 THEN X=X*RND(1)
4190 H1=INT(X/K3):FOR I=1 TO 3:IF K(I,3)<=0 THEN 4270
4191 REM **********  SOUND EFFECTS FOR PHASERS FIRING  **********
4192 FOR QQQ = 3000 TO 2500 STEP -10:SOUND QQQ,.5:NEXT QQQ:SOUND 75,5
4200 H=INT((H1/(FND(0)+1))*(1+RND(1))):IF H>(.15*K(I,3)) THEN 4220
4210 PRINT"SENSORS SHOW NO DAMAGE TO ENEMY AT ";K(I,1);",";K(I,2):GOTO 4270
4220 K(I,3)=INT(K(I,3)-H):PRINT H;"UNIT HIT ON KLINGON AT SECTOR";K(I,1);",";
4230 PRINT K(I,2):IF K(I,3)<=0 THEN PRINT"*** KLINGON DESTROYED ***" ELSE 4240
4235 GOTO 4250
4240 PRINT"   (SENSORS SHOW";K(I,3);"UNITS REMAINING)":GOTO 4270
4250 K3=K3-1:K9=K9-1:Z1=K(I,1):Z2=K(I,2):A$="   ":GOSUB 10780
4260 K(I,3)=0:G(Q1,Q2)=G(Q1,Q2)-100:Z(Q1,Q1)=G(Q1,Q2):IF K9<=0 THEN 5960
4270 NEXT I:GOSUB 5760:GOTO 1860
4690 REM *  *  *  *  *  PHOTON TORPEDO CODE BEGINS HERE  *  *  *  *  *
4700 IF P<=0 THEN PRINT"ALL PHOTON TORPEDOES EXPENDED":GOTO 1860
4710 IF D(5)<0 THEN PRINT"PHOTON TUBES ARE NOT OPERATIONAL":GOTO 1860
4712 IF WIND=0 THEN 4720
4714 PRINT:PRINT"  SENSORS DETECT STELLAR WINDS OF FORCE"; INT(WIND*100)
4716 INPUT"  DO YOU WISH TO CANCEL THE COMMAND TO FIRE A TORPEDO (Y/N)";F$
4718 IF F$="Y" OR F$="YES" THEN 1860
4720 PRINT:INPUT"PHOTON TORPEDO COURSE (1-9)";C1:IF C1=9 THEN C1=1
4730 IF C1>=1 AND C1<9 THEN 4760
4740 PRINT"ENSIGN CHEKOV REPORTS,  `INCORRECT COURSE DATA, SIR!'"
4760 X1=-SIN((C1-1)*.7853982)+WIND:E=E-2:P=P-1
4770 X2=COS((C1-1)*.7853981)+WIND:X=S1:Y=S2
4780 REM **********  PHOTON SOUND EFFECTS  **********
4785 SOUND (X*Y*100),20
4790 PRINT"TORPEDO TRACK:"
4800 X=X+X1:Y=Y+X2:X3=INT(X+.5):Y3=INT(Y+.5)
4810 IF X3<1 OR X3>8 OR Y3<1 OR Y3>8 THEN 5010
4820 PRINT"               ";X3;",";Y3:A$="   ":Z1=X:Z2=Y:GOSUB 10940
4830 IF Z3<>0 THEN 4800
4840 A$="+K+":Z1=X:Z2=Y:GOSUB 10940:IF Z3=0 THEN 4890
4850 PRINT"*** KLINGON DESTROYED ***":K3=K3-1:K9=K9-1:IF K9<=0 THEN 5960
4860 FOR I=1 TO 3:IF X3=K(I,1) AND Y3=K(I,2) THEN 4880
4870 NEXT I:I=3
4880 K(I,3)=0:GOTO 4990
4890 A$=" * ":Z1=X:Z2=Y:GOSUB 10940:IF Z3=0 THEN 4910
4900 PRINT"STAR AT";X3;",";Y3;"ABSORBED TORPEDO ENERGY.":GOSUB 5760:GOTO 1860
4910 A$=">B<":Z1=X:Z2=Y:GOSUB 10940:IF Z3=0 THEN 4720
4920 PRINT"*** STARBASE DESTROYED ***":B3=B3-1:B9=B9-1
4930 IF B9>0 OR K9>T-T0-T9 THEN 4970
4940 PRINT"THAT DOES IT, CAPTAIN!!  YOU ARE HEREBY RELIEVED OF COMMAND"
4950 PRINT"AND SENTENCED TO 00 STARDATES AT HARD LABOR ON CYGNUS 12!!"
4960 GOTO 5890
4970 PRINT"STARFLEET COMMAND REVIEWING YOUR RECORD TO CONSIDER"
4980 PRINT"COURT MARTIAL!":D0=0
4990 Z1=X:Z2=Y:A$="   ":GOSUB 10780
5000 G(Q1,Q2)=K3*100+B3*10+S3:Z(Q1,Q2)=G(Q1,Q2):GOSUB 5760:GOTO 1860
5010 PRINT"TORPEDO MISSED":GOSUB 5760:GOTO 1860
5490 REM *  *  *  *  *  *  SHIELD CONTROL  *  *  *  *  *  *
5500 IF D(7)<0 THEN PRINT"SHIELD CONTROL INOPERABLE":GOTO 1860
5510 PRINT"ENERGY AVAILABLE =";E+S;:INPUT"      NUMBER OF UNITS TO SHIELDS";X
5520 IF X<0 OR S=X THEN PRINT"":GOTO 1860
5530 IF X<=E+S THEN 5560
5540 PRINT"SHIELD CONTROL REPORTS  `THIS IS NOT THE FEDERATION TREASURY.'"
5550 PRINT"":GOTO 1860
5560 E=E+S-X:S=X:PRINT"DEFLECTOR CONTROL ROOM REPORT:"
5570 PRINT"  `SHIELDS NOW AT";INT(S);"UNITS PER YOUR COMMAND.'":GOTO 1860
5590 REM *  *  *  *  *  *  DAMAGE CONTROL  *  *  *  *  *  *
5600 IF D(6)>=0 THEN 5720
5610 PRINT"DAMAGE CONTROL REPORT NOT AVAILABLE":IF D0=0 THEN 1860
5620 D3=0:FOR I=1 TO 8:IF D(I)<0 THEN D3=D3+.1
5630 NEXT I:IF D3=0 THEN 1860
5640 PRINT:D3=D3+D4:IF D3>=1 THEN D3=.9000001
5650 PRINT"TECHNICIANS STANDING BY TO EFFECT REPAIRS TO YOUR SHIP;"
5670 PRINT"ESTIMATED TIME TO REPAIR:";.01*INT(100*D3);"STARDATES"
5680 INPUT"WILL YOU AUTHORIZE THE REPAIR ORDER (Y/N)";A$
5690 IF A$<>"Y" THEN 1860
5700 FOR I=1 TO 8:IF D(I)<0 THEN D(I)=0
5710 NEXT I:T=T+D3+.1
5720 PRINT:PRINT"DEVICE             STATE OF REPAIR":FOR R1=1 TO 8
5730 GOSUB 10840:PRINT G2$;LEFT$(Z$,25-LEN(G2$));INT(D(R1)*100)*.01
5740 NEXT R1:PRINT:IF D0<>0 THEN 5620
5750 GOTO 1860
5755 REM *  *  *  *  *  *  KLINGONS SHOOTING  *  *  *  *  *  *
5760 IF K3<=0 THEN RETURN
5770 IF D0<>0 THEN PRINT"STARBASE SHIELDS PROTECT THE ENTERPRISE":RETURN
5775 IF .2>RND(1) THEN RETURN
5780 FOR I=1 TO 3:IF K(I,3)<=0 THEN 5840
5785 H=INT((K(I,3)/FND(1))*(2+RND(1))):S=S-H:K(I,3)=K(I,3)/(3+RND(0))
5787 IF H<=0 THEN 5795
5788 REM ********** SOUND OF KLINGON ATTACK ON ENTERPRISE
5789 FOR QQQ = 300 TO 250 STEP -10:SOUND QQQ,1:SOUND QQQ+5,1:SOUND QQQ-5,1
5790 NEXT QQQ:SOUND 50,20
5791 PRINT H;"UNIT HIT ON ENTERPRISE FROM SECTOR";K(I,1);",";K(I,2)
5795 IF S<=0 THEN 5870
5800 PRINT"      ":IF H<20 THEN 5840
5810 IF RND(1)>.6 OR H/S<=.02 THEN 5840
5820 R1=FNR(1):D(R1)=D(R1)-H/S-.5*RND(1):GOSUB 10840
5830 PRINT"DAMAGE CONTROL REPORTS `";G2$;" DAMAGED BY THE HIT'"
5840 NEXT I:RETURN
5850 REM * * * * * *  END OF GAME  * * * * * *
5860 PRINT"IT IS STARDATE";T:GOTO 5890
5870 PRINT:PRINT"THE ENTERPRISE HAS BEEN DESTROYED.  THE FEDERATION ";
5880 PRINT"WILL BE CONQUERED":GOTO 5860
5890 PRINT"THERE WERE";K9;"KLINGON BATTLE CRUISERS LEFT AT"
5900 PRINT"THE END OF YOUR MISSION."
5910 PRINT:PRINT:IF B9=0 THEN 5950
5920 PRINT"THE FEDERATION IS IN NEED OF A NEW STARSHIP COMMANDER"
5930 PRINT"FOR A SIMILAR MISSION -- IF THERE IS A VOLUNTEER,"
5940 INPUT"LET HIM STEP FORWARD AND ENTER `AYE'",A$:IF A$="AYE" THEN 10
5950 END
5960 PRINT"CONGRATULATIONS CAPTAIN!  THE LAST KLINGON BATTLE CRUISER"
5970 PRINT"MENACING THE FEDERATION HAS BEEN DESTROYED.":PRINT
5980 PRINT"YOUR EFFICIENCY RATING IS";INT(100*(K7/(T-T0))^2):GOTO 5910
5990 REM *  *  *  SHORT RANGE SENSOR SCAN AND STARTUP SUBROUTINE  *  *  *
6000 FOR I=S1-1 TO S1+1:FOR J=S2-1 TO S2+1
6005 FOR U=1 TO 100:NEXT U:CLS
6010 IF INT(I+.5)<1 OR INT(I+.5)>8 OR INT(J+.5)<1 OR INT(J+.5)>8 THEN 6030
6020 A$=">B<":Z1=I:Z2=J:GOSUB 10940:IF Z3=1 THEN 6040
6030 NEXT J:NEXT I:D0=0:GOTO 6060
6040 D0=1:C$="DOCKED":E=E0:P=P0
6050 PRINT"SHIELDS DROPPED FOR DOCKING PURPOSES":S=0:GOTO 6080
6060 IF K3>0 THEN C$="*RED*":GOTO 6080
6070 C$="GREEN":IF E=0 THEN 6100
6090 PRINT:PRINT"*** SHORT RANGE SENSORS ARE OUT ***":PRINT:RETURN
6100 O1$="---------------------------------":PRINT O1$:FOR I=1 TO 8
6110 FOR J=(I-1)*24+1 TO (I-1)*24+22 STEP 3:PRINT" ";MID$(Q$,J,3);:NEXT J
6120 ON I GOTO 6130,6140,6150,6160,6170,6180,6190,6200
6130 PRINT"        STARDATE          ";INT(T*10)*.1:GOTO 6210
6140 PRINT"        CONDITION          ";C$:GOTO 6210
6150 PRINT"        QUADRANT          ";Q1;",";Q2:GOTO 6210
6160 PRINT"        SECTOR            ";S1;",";S2:GOTO 6210
6170 PRINT"        PHOTON TORPEDOES  ";INT(P):GOTO 6210
6180 PRINT"        TOTAL ENERGY      ";INT(E+S):GOTO 6210
6190 PRINT"        SHIELDS           ";INT(S):GOTO 6210
6200 PRINT"        KLINGONS REMAINING";INT(K9)
6210 NEXT I:PRINT O1$:RETURN
6490 REM *  *  *  *  *  *  LIBRARY COMPUTER CODE  *  *  *  *  *  *
6500 IF D(8)<0 THEN PRINT"COMPUTER DISABLED":GOTO 1860
6510 INPUT"COMPUTER ACTIVE AND AWAITING COMMAND";A:IF A<0 THEN 1860
6520 PRINT:H8=1:ON A+1 GOTO 6630,6780,6870,7130,6930,6610
6530 PRINT"FUNCTIONS AVAILABLE FROM LIBRARY-COMPUTER:"
6540 PRINT"   0 = CUMULATIVE GALACTIC RECORD"
6550 PRINT"   1 = STATUS REPORT"
6560 PRINT"   2 = PHOTON TORPEDO DATA"
6570 PRINT"   3 = STARBASE NAV DATA"
6580 PRINT"   4 = DIRECTION/DISTANCE CALCULATOR"
6590 PRINT"   5 = GALAXY `REGION NAME' MAP":PRINT:GOTO 6510
6600 REM *  *  *  *  SETUP TO CHANGE CUM GAL RECORD TO GALAXY MAP  *  *  *  *
6610 CLS:PRINT:PRINT
6615 H8=0:G5=1:PRINT"                        THE GALAXY":GOTO 6680
6620 REM *  *  *  *  *  *  CUM GALACTIC RECORD  *  *  *  *  *  *
6630 CLS:INPUT "DO YOU WANT A HARDCOPY?  IS PRINTER ON (Y/N)";A$
6640 IF A$="Y" THEN 13000
6650 PRINT:PRINT"        ";
6660 PRINT"COMPUTER RECORD OF GALAXY FOR QUADRANT";Q1;",";Q2
6670 PRINT
6680 O1$="        1     2     3     4     5     6     7     8"
6690 PRINT "   ----- ----- ----- ----- ----- ----- ----- -----"
6700 PRINT O1$:FOR I=1 TO 8:PRINT I;:IF H8=0 THEN 6740
6710 FOR J=1 TO 8:PRINT"   ";:IF Z(I,J)=0 THEN PRINT"***";:GOTO 6730
6720 PRINT RIGHT$(STR$(Z(I,J)+1000),3);
6730 NEXT J:GOTO 6760
6740 Z4=I:Z5=1:GOSUB 11000:J0=INT(15-.5*LEN(G2$)):PRINT TAB(J0);G2$;
6750 Z5=5:GOSUB 11000:J0=INT(39-.5*LEN(G2$)):PRINT TAB(J0);G2$;
6760 PRINT:PRINT O1$:NEXT I
6761 DEF SEG=&HB000:LET SPOT=(479+Q1*320+Q2*12)
6763 FOR RT=2 TO 6 STEP 2:POKE SPOT+RT,&H8F:NEXT RT:DEF SEG
6765 GOTO 1860
6770 REM *  *  *  *  *  *  STATUS REPORT  *  *  *  *  *  *
6780 CLS:PRINT:PRINT:PRINT
6785 PRINT "   STATUS REPORT:":X$="":IF K9>1 THEN X$="S"
6790 PRINT"KLINGON";X$;" LEFT: ";K9
6800 PRINT"MISSION MUST BE COMPLETED IN";.1*INT((T0+T9-T)*10);"STARDATES"
6810 X$="S":IF B9<2 THEN X$="":IF B9<1 THEN 6840
6820 PRINT"THE FEDERATION IS MAINTAINING";B9;"STARBASE";X$;" IN THE GALAXY"
6830 GOTO 5600
6840 PRINT"YOUR STUPIDITY HAS LEFT YOU ON YOUR ON IN"
6850 PRINT"  THE GALAXY -- YOU HAVE NO STARBASES LEFT!":GOTO 5600
6860 REM *  *  *  *  TORPEDO, BASE NAV, D/D CALCULATOR  *  *  *  *
6870 IF K3<=0 THEN 4110
6880 X$="":IF K3>1 THEN X$="S"
6890 PRINT"FROM ENTERPRISE TO KLINGON BATTLE CRUISER";X$
6900 H8=0:FOR I=1 TO 3:IF K(I,3)<=0 THEN 7120
6910 W1=K(I,1):X=K(I,2)
6920 C1=S1:A=S2:GOTO 6970
6930 PRINT"DIRECTION/DISTANCE CALCULATOR:"
6940 PRINT"YOU ARE AT QUADRANT ";Q1;",";Q2;" SECTOR ";S1;",";S2
6950 PRINT"PLEASE ENTER":INPUT"  INITIAL COORDINATES (X,Y)";C1,A
6960 INPUT"  FINAL COORDINATES (X,Y)";W1,X
6970 X=X-A:A=C1-W1:IF X<0 THEN 7040
6980 IF A<0 THEN 7060
6990 IF A>0 THEN 7010
7000 IF A=0 THEN C1=5:GOTO 7020
7010 C1=1
7020 IF ABS(A)<=ABS(X) THEN 7035
7030 PRINT "DIRECTION =";C1+(((ABS(A)-ABS(X))+ABS(A))/ABS(A)):GOTO 7110
7035 PRINT "DIRECTION =";C1+(ABS(A)/ABS(X)):GOTO 7110
7040 IF A>0 THEN C1=3:GOTO 7070
7050 IF X<>0 THEN C1=5:GOTO 7020
7060 C1=7
7070 IF ABS(A)>=ABS(X) THEN 7090
7080 PRINT "DIRECTION =";C1+(((ABS(X)-ABS(A))+ABS(X))/ABS(X)):GOTO 7110
7090 PRINT "DIRECTION =";C1+(ABS(X)/ABS(A))
7110 PRINT"DISTANCE =";SQR(X^2+A^2):IF H8=1 THEN 1860
7120 NEXT I:GOTO 1860
7130 IF B3<>0 THEN PRINT"FROM ENTERPRISE TO STARBASE:":W1=B4:X=B5:GOTO 6920
7140 PRINT"MR. SPOCK REPORTS,  `SENSORS SHOW NO STARBASES IN THIS";
7150 PRINT" QUADRANT.'":GOTO 1860
10740 REM * * * *  FIND EMPTY PLACE IN QUADRANT (FOR THINGS)  * * * *
10750 R1=FNR(1):R2=FNR(1):A$="   ":Z1=R1:Z2=R2:GOSUB 10940:IF Z3=0 THEN 10750
10760 RETURN
10770 REM * * * * * *  INSERT IN STRING ARRAY FOR QUADRANT  * * * * * *
10780 S8=INT(Z2-.5)*3+INT(Z1-.5)*24+1
10790 IF LEN(A$)<>3 THEN PRINT"ERROR . . . 10790":STOP
10800 IF S8=1 THEN Q$=A$+RIGHT$(Q$,189):RETURN
10810 IF S8=190 THEN Q$=LEFT$(Q$,189)+A$:RETURN
10820 Q$=LEFT$(Q$,S8-1)+A$+RIGHT$(Q$,190-S8):RETURN
10830 REM * * * * * *  PRINT DEVICE NAME  * * * * * *
10840 ON R1 GOTO 10850,10860,10870,10880,10890,10900,10910,10920
10850 G2$="WARP ENGINES":RETURN
10860 G2$="SHORT RANGE SENSORS":RETURN
10870 G2$="LONG RANGE SENSORS":RETURN
10880 G2$="PHASER CONTROL":RETURN
10890 G2$="PHOTON TUBES":RETURN
10900 G2$="DAMAGE CONTROL":RETURN
10910 G2$="SHIELD CONTROL":RETURN
10920 G2$="LIBRARY-COMPUTER":RETURN
10930 REM * * * * * *  STRING COMPARISON IN QUADRANT ARRAY  * * * * * *
10940 Z1=INT(Z1+.5):Z2=INT(Z2+.5):S8=(Z2-1)*3+(Z1-1)*24+1:Z3=0
10950 IF MID$(Q$,S8,3)<>A$ THEN RETURN
10960 Z3=1:RETURN
10970 REM * * * * *  QUADRANT NAME IN G2$ FROM Z4,Z5 (=Q1,Q2)  * * * * *
10980 REM * * * * *  CALL WITH G5=1 TO GET REGION NAME ONLY
11000 IF Z5<=4 THEN ON Z4 GOTO 11010,11020,11030,11040,11050,11060,11070,11080
11010 GOTO 11100
11020 G2$="ANTARES":GOTO 11190
11030 G2$="RIGEL":GOTO 11190
11040 G2$="PROCYON":GOTO 11190
11050 G2$="VEGA":GOTO 11190
11060 G2$="CANOPUS":GOTO 11190
11070 G2$="ALTAIR":GOTO 11190
11080 G2$="SAGITARIUS":GOTO 11190
11090 G2$="POLLUX":GOTO 11190
11100 ON Z4 GOTO 11110,11120,11130,11140
11110 G2$="SIRIUS":GOTO 11190
11120 G2$="DENEB":GOTO 11190
11130 G2$="CAPELLA":GOTO 11190
11140 G2$="BETELGEUSE":GOTO 11190
11150 G2$="ALDEBARAN":GOTO 11190
11160 G2$="REGULUS":GOTO 11190
11170 G2$="ARCTURUS":GOTO 11190
11180 G2$="SPICA"
11190 IF G5<>1 THEN ON Z5 GOTO 11210,11220,11230,11240,11210,11220,11230,11240
11200 RETURN
11210 G2$=G2$+" I":RETURN
11220 G2$=G2$+" II":RETURN
11230 G2$=G2$+" III":RETURN
11240 G2$=G2$+" IV":RETURN
12000 FOR U=1 TO 400:NEXT U:RETURN
12500 REM  **********  SOUND OF WARP ENGINE ENGAGING  **********
12510 PLAY "MB"
12520 FOR I = 37 TO 90:SOUND I,.8:NEXT I:PLAY "MB"
12530 FOR I = 5000 TO 4000 STEP -40:SOUND I,.2:NEXT I
12540 RETURN
13000 REM **********  PRINT REPORT TO LINE PRINTER  **********
13010 LPRINT:LPRINT "       ";
13020 LPRINT "COMPUTER RECORD OF GALAXY FOR QUADRANT";Q1;",";Q2:LPRINT
13030 O1$="       1     2     3     4     5     6     7     8"
13040 LPRINT "    ----- ----- ----- ----- ----- ----- ----- -----"
13050 LPRINT O1$:FOR I=1 TO 8:LPRINT I;:IF H8=0 THEN 13090
13060 FOR J=1 TO 8:LPRINT "   ";:IF Z(I,J)=0 THEN LPRINT "***";:GOTO 13080
13070 LPRINT RIGHT$(STR$(Z(I,J)+1000),3);
13080 NEXT J:GOTO 13110
13090 Z4=I:Z5=1:GOSUB 11000:J0=INT(15-.5*LEN(G2$)):LPRINT TAB(J0);G2$;
13100 Z4=I:Z5=1:GOSUB 11000:J0=INT(15-.5*LEN(G2$)):LPRINT TAB(J0);G2$;
13110 LPRINT:LPRINT O1$:NEXT I:LPRINT:GOTO 1860