100   ' ***********************************************************************
150   ' *                                                                     *
200   ' *                           L A S E R                                 *
250   ' * C. HUBER 286                                                       *
300   ' ***********************************************************************
350   '
400   '   There are two data files associated with this program, they are:
450   '
500   '   LASERFONT:
550   '
600   '       This is the FONT file that is utilized to generate the various
650   '       characters that will be displayed during the course of the game.
700   '       Provided the system is capable of SOFT FONT operation.
750   '
800   '   LASERINST:
850   '
900   '       This is a data file that will be displayed if HELP is requested
950   '       to learn the fundamentals of the game.
1000  '
1050  '   IT IS ASCERTAINED IF THE PARTICULAR FILE TO BE USED AT ANY POINT
1100  '   IN TIME IS PRESENT BEFORE IT IS USED. IF NOT PRESENT, YOU ARE
1150  '   NOTIFIED, AND THE GAME CONTINUES ON.
1200  '
1250  '   This program queries the SYSTEM BTOS to ascertain what kind of
1300  '   system I am. If a B25 or greater I will load LASERFONT into
1350  '   the VIDEO RAMS and generate some neat looking characters, provided
1400  '   the LASERFONT file is present. If not you get what you get.
1450  '
1500  '   I also ascertain if this is ANY type COLOR system and if so I then
1550  '   set up the COLOR RAMS accordingly.
1600  '
1650  '   Also during the course of playing the game the keyboard is altered
1700  '   to UNENCODEMODE so I can sample keyboard inputs on the fly.
1750  '$PAGE
1800  '         *****     FIND OUT WHAT TYPE SYSTEM I AM     *****
1850  '
1900  '         *****         AND IF APPLICABLE THEN         *****
1950  '
2000  '         *****          LOAD LASERFONT FILE          *****
2050  '         *****             LOAD COLOR RAMS            *****
2100  '
2150  DIM SV(50), SH(50) : WATTS=10000 : WRP$=5 : REST=0     ' POSSIBLE STARS
2200  RANDOMIZE : B=0 : FLG3=0 : COLOR=0 : Q$=CHR$(164) : QQ$ = Q$
2250  X$ = STRING$(90, ) : B26 = 0
2300  Z$ =   : ACPT = 2
2350  ERC = QUERYVIDHDW(PTR(X$),90)                ' WHAT KIND OF SYSTEM AM I
2400  Z$ = MID$(X$,1,1)                             ' PROCESSOR TYPE  ?
2450  A  = PEEK(B,PTR(Z$))
2500  Z$ = MID$(X$,5,1)                             ' GRAPHICS OR COLOR ??
2550  B  = PEEK(B,PTR(Z$))
2600  SYSTYP$ = INVALID SYSTEM TYPE
2650  IF A = 0 THEN SYSTYP$ = CHR$(138)+ B22 WITH 
2700  IF A = 2 THEN SYSTYP$ = B21 WITH 
2750  IF A = 4 THEN SYSTYP$ = CHR$(138)+ B26 WITH  : B26 = 1
2800  IF A = 3 THEN SYSTYP$ = CHR$(138)+ B28 WITH  : B26 = 1
2850  IF A = 1 THEN SYSTYP$ = CHR$(138)+ B27 WITH  : B26 = 1
2900  BITMAP$ = UNKNOWN BIT MAP LEVEL
2950  IF B = 0 THEN BITMAP$ = NO GRAPHICS OR COLOR
3000  IF B = 3 THEN BITMAP$ = COLOR  GRAPHICS : COLOR = 1
3050  IF B26 = 0 THEN GOTO 4150                       ' NO SOFT FONT AVAILABLE
3100  BITMAP$ = SOFT CHARACTER FONT : FONTFH = 0 : MODE = H6D6D ' mm
3150  WORD=0 : FONT$=LASERFONT : J=HFFFF : K=H2020 : L=0 : M=0
3200  ERC=OPENFILE(PTR(FONTFH),FONT$,,MODE)      ' LASERFONT PRESENT
3250  IF ERC = 0 THEN GOTO 3500                      ' YES
3300  PRINT CHR$(12);FILE LASERFONT NOT PRESENT  ;
3350  PRINT CONTINUE WITHOUT IT YN ; : N$ = INPUT$(1)
3400  IF N$ <> Y AND N$ <> y THEN END
3450  B26=0 : Q$=CHR$(164) : GOTO 4150
3500  ERC=ALLOCMEMORYLL(8704,PTR(L))          : IF ERC <> 0 THEN GOTO 3950
3550  ERC=LOADFONTRAM(FONTFH,L,8704)         : IF ERC <> 0 THEN GOTO 3950
3600  ERC=CLOSEFILE(FONTFH)                   : IF ERC <> 0 THEN GOTO 3950
3650  ERC=RESETVIDEO(80,28,J,K,PTR(WORD))   : IF ERC <> 0 THEN GOTO 3950
3700  ERC=INITVIDFRAME(0,0,0,80,28,0,K,0,0,0) : IF ERC <> 0 THEN GOTO 3950
3750  ERC=INITCHARMAP(M,WORD)                : IF ERC <> 0 THEN GOTO 3950
3800  ERC=SETSCREENVIDATTR(1,J)               : IF ERC <> 0 THEN GOTO 3950
3850  ERC=DEALLOCMEMORYLL(L,8704)             : IF ERC <> 0 THEN GOTO 3950
3900  Q$ = CHR$(165) : GOTO 4150                ' ALL OK  GO FOR IT
3950  PRINT CHR$(12);SYSTEM ERROR LOADING LASERFONT, ERC = ;ERC
4000  PRINT : PRINT Continue YN ;
4050  N$ = INPUT$(1) : B26=0
4100  IF N$ <> Y AND N$ <> y THEN END
4150  IF COLOR = 0 THEN GOTO 4450
4200  '
4250  '            MAKE SOME ROOM TO LOAD COLOR RAMS AT A LATER TIME
4300  '$PAGE
4350  '                *****     DISPLAY WELCOME     *****
4400  '
4450  PRINT CHR$(12) : PRINT : PRINT
4500  PRINT TAB(20);
4550  PRINT TAB(20);                                     
4600  PRINT TAB(20);            W E L C O M E            
4650  PRINT TAB(20);                                     
4700  PRINT TAB(20);                 T O                   
4750  PRINT TAB(20);                                     
4800  PRINT TAB(20);              L A S E R              
4850  IF B26=0 THEN PRINT TAB(20);crh 286                             ELSE  PRINT TAB(20);                                  
4900  PRINT TAB(20); : PRINT
4950  PRINT TAB(20);* * * *  VIDEO   CONFIGURATION  * * * *
5000  MSG$ = SYSTYP$+BITMAP$
5050  PRINT TAB((80LEN(MSG$))2);MSG$
5100  IF COLOR = 1 THEN MSG$ = COLOR NOT IMPLEMENTED : GOSUB 9150
5150  PRINT : MSG$ = CAST OF CHARACTERS : GOSUB 9150 : PRINT
5200  IF B26 = 1 THEN PRINT TAB(16);QUIRKERS = ;QQ$, ;Q$;, ;CHR$(166);
5250  IF B26 = 0 THEN PRINT TAB(20);QUIRKER = ;QQ$;
5300  PRINT , STAR = *, FUEL STATION = ;CHR$(253) : PRINT
5350  IF B26 <> 1 THEN GOTO 5600
5400  PRINT TAB(15);STARLIGHT: UP = ;CHR$(134);, DOWN = ;CHR$(135); , LEFT = ;CHR$(136);, RIGHT = ;CHR$(137)
5450  PRINT
5500  PRINT TAB(15);LASER FIRE: UP = ;CHR$(130);, DOWN = ;CHR$(131); , LEFT = ;CHR$(132);, RIGHT = ;CHR$(133)
5550  GOTO 5750
5600  PRINT TAB(15);STARLIGHT: UP = ^, DOWN = V, LEFT = <, RIGHT = >
5650  PRINT : TARGETS=0 : SCORE=0 : WATTS=0 : STAR=0 : SSTAR=0
5700  PRINT TAB(15);LASER FIRE: UP = ;CHR$(225);, DOWN = ;CHR$(225); , LEFT = ;CHR$(218);, RIGHT = ;CHR$(218)
5750  PRINT CHR$(255)+C+CHR$(0)+CHR$(0);ENTER YOUR NAME (MAX 7 CHARACTERS);
5800  INPUT  ;N$ : A = LEN(N$) : IF A > 7 THEN GOTO 5750
5850  IF A = 7 THEN PLAYER$ = N$ : GOTO 5950
5900  PLAYER$ = N$+STRING$(7A, )
5950  PRINT CHR$(12);CHR$(255)+VF : QTOG = 0 : STOG = 0
6000  PRINT Do you require HELP: YN; : N$ = INPUT$(1)
6050  IF N$ = QQ$ THEN GOTO 7500                             ' SMART PEOPLES
6100  IF N$ <> Y AND N$ <> y THEN GOTO 7300
6150  FILEID$ = LASERINST
6200  PAT$ = [D0]<*>
6250  ERC = OPENFILE (PTR(B),PTR(FILEID$),10,PTR(PAT$),7,2)
6300  IF ERC = 218 THEN CLOSE : GOTO 6650
6350  MSG$ = FILE LASERINST NOT PRESENT
6400  ACPT=2 : GOSUB 9100 : PRINT
6450  MSG$ = FOR HELP  LOAD LASERINST
6500  ACPT = 2 : GOSUB 9150 : PRINT
6550  MSG$ = I AM IGNORING HELP REQUEST : ACPT = 0 : GOSUB 9150
6600  GOTO 7300
6650  OPEN I, 1, FILEID$
6700  CNT = 0
6750  FOR I = 1 TO 99999
6800  IF CNT = 0 THEN PRINT CHR$(12);
6850  LINE INPUT 1, MSG$
6900  IF LEFT$(MSG$,3) <> $$$ THEN GOTO 7050
6950  GOSUB 39800
7000  MSG$ =        : CNT = CNT + 2      
7050  PRINT MSG$ : CNT = CNT + 1
7100  IF LEFT$(MSG$,5) = Press THEN N$ = INPUT$(1) : CNT = 0
7150  IF N$ = E OR N$ = CHR$(164) THEN GOTO 7300
7200  IF EOF(1) THEN GOTO 7300
7250  NEXT I
7300  CLOSE 1
7350  IF HELP = 1 THEN GOTO 27950
7400  AUTOP = 0 : AUTOF = 0
7450  IF N$ <> CHR$(164) THEN GOTO 8000               ' NOT SMART ENOUGH
7500  ACPT = 2
7550  MSG$=CONGRATULATIONS, you found the MAGIC KEY SET : GOSUB 9100
7600  IF B26 = 0 THEN MSG$ = STRING$(45,N$) : GOTO 7800
7650  IF B26 = 1 THEN MSG$=CHR$(164)+ +Q$+ +CHR$(166)+ 
7700  PRINT : PRINT TAB(19);
7750  FOR I=1 TO 7 : PRINT MSG$; : NEXT I : PRINT : PRINT : GOTO 7850
7800  PRINT : PRINT TAB((80LEN(MSG$))2);MSG$ : PRINT
7850  MSG$=*   PROGRAM WILL RUN WITH MAXIMUM OPTIONS  * : GOSUB 9150
7900  PRINT : ACPT=1 : MSG$ =PRESS ANY KEY : GOSUB 9150
7950  N$ = 0 : AUTOP = 1 : AUTOF = 1 : GOTO 8500
8000  ACPT=2 : MSG$ = Would you like a short sample of MACH 5 : GOSUB 9100
8050  ACPT=1 : MSG$ = AUTO PILOT and FIRE CONTROL ACTIVE  YN : GOSUB 9150
8100  IF N$ = N OR N$ = n THEN GOTO 8400
8150  ACPT=0 : MSG$ = OKAY
8200  GOSUB 9100
8250  SAMPLE=1 : N$=5 : AUTOP=1 : AUTOF=1 : WRP$=5 : GOTO 8500
8300  ACPT=2 : MSG$ = Sample run at MACH 5 is OVER : GOSUB 9100
8350  MSG$ = It is now time to BEGIN GAME : GOSUB 9150 : PRINT
8400  SAMPLE = 0 : AUTOP = 0 : AUTOF = 0
8450  ACPT=1 : MSG$ = Enter MACH SPEED 1 to 9 OR 0 : GOSUB 9150
8500  WRP$ = N$ : MACH = VAL(N$)
8550  IF MACH = 0 THEN SPEED = 1 : GOTO 13700
8600  SPEED = 450MACH : N$ =  
8650  GOTO 13700
8700  '$PAGE
8750  ' **********************************************************************
8800  ' *                                                                    *
8850  ' *                THE FOLLOWING OP'S ARE SUB ROUTINES                 *
8900  ' *                                                                    *
8950  ' **********************************************************************
9000  '
9050  '                     MESSAGES TOFROM CONSOLE
9100  PRINT CHR$(12) : FOR I = 1 TO 12 : PRINT : NEXT I
9150  PRINT TAB((80LEN(MSG$))2);CHR$(255)+AE;MSG$;CHR$(255)+AA 
9200  IF ACPT = 2 THEN RETURN
9250  IF ACPT = 1 THEN N$ = INPUT$(1) : PRINT
9300  IF ACPT = 0 OR ACPT = 3 THEN FOR ZZ = 1 TO 15000 : NEXT ZZ
9350  RETURN
9400  '
9450  '           GENERATE AND DISPLAY PROPER STAR SHIP  IN GREEN
9500  '
9550  IF B26 = 0 THEN GOTO 9850
9600  IF DIR=1 THEN SS$ = CHR$(134)
9650  IF DIR=2 THEN SS$ = CHR$(135)
9700  IF DIR=3 THEN SS$ = CHR$(136)
9750  IF DIR=4 THEN SS$ = CHR$(137)
9800  GOTO 10050
9850  IF DIR = 1 THEN SS$ = ^                        ' GOING UP
9900  IF DIR = 2 THEN SS$ = V                        ' GOING DOWN
9950  IF DIR = 3 THEN SS$ = <                        ' GOING LEFT
10000 IF DIR = 4 THEN SS$ = >                        ' GOING RIGHT
10050 PRINT CHR$(255)+C+CHR$(SSSH)+CHR$(SSSV); ;
10100 PRINT CHR$(255)+C+CHR$(SSH)+CHR$(SSV);SS$;     ' SHOW NEW FIRELIGHT
10150 RETURN
10200 '
10250 '                   LET A QUIRKER APPEAR IN YELLOW
10300 '
10350 IF QTOG = 0 THEN QQ$ = CHR$(164) ELSE QQ$ = CHR$(166)
10400 PRINT CHR$(255)+C+CHR$(TH)+CHR$(TV);QQ$;
10450 IF B26 = 0 THEN RETURN
10500 IF QTOG = 0 THEN QTOG = 1 ELSE QTOG = 0
10550 RETURN
10600 '
10650 '                  DISPLAY GENERATED STARS IN BLUE
10700 '
10750 PRINT CHR$(255)+C+CHR$(SH(SQ))+CHR$(SV(SQ));*; : RETURN
10800 '
10850 '               DISPLAY A REFUELING STATION IN ORANGE
10900 '
10950 PRINT CHR$(255)+C+CHR$(BH)+CHR$(BV);CHR$(253);   : RETURN
11000 '
11050 '                DISPLAY THE FIRING LASERS IN WHITE
11100 '
11150 PRINT CHR$(255)+C+CHR$(H)+CHR$(V);LASER$;        : RETURN
11200 '
11250 '                  IF NOT QUIET THEN BEEP THE HORN
11300 '
11350 IF QUIET = 0 THEN PRINT CHR$(7); : RETURN ELSE     : RETURN
11400 '
11450 '              DISPLAY THE EXPLOSIONS OR CRASHES IN RED
11500 '
11550 PRINT CHR$(255)+C+CHR$(EH)+CHR$(EV);MSG1$; 
11600 GOSUB 11350
11650 IF EV <> 0 THEN PRINT CHR$(255)+C+CHR$(EH)+CHR$(EV1);MSG2$;
11700 IF EV < 24 THEN PRINT CHR$(255)+C+CHR$(EH)+CHR$(EV+1);MSG3$;
11750 IF CRASHP = 1 OR CRASHQ = 1 THEN ZZZ = 5000 ELSE ZZZ = 1500
11800 FOR ZZ = 1 TO ZZZ : NEXT ZZ         ' SLEEP SO YOU CAN SEE THE EXPLOSION
11850 FLG2 = 0                            ' CLEAR TO PRINT FUEL LEVELS
11900 PRINT CHR$(255)+C+CHR$(EH)+CHR$(EV);M1$;
11950 IF EV <> 0 THEN PRINT CHR$(255)+C+CHR$(EH)+CHR$(EV1);M1$;
12000 IF EV < 24 THEN PRINT CHR$(255)+C+CHR$(EH)+CHR$(EV+1);M1$;
12050 RETURN
12100 '
12150 '  BLINK THE CONSOLE LIGHTS AS A MARQUIS UPON REFUELING OR PAUSING
12200 '
12250 ON TOG GOSUB 12400,12450,12500,12550,12600,12650,12700
12300 TOG = TOG + 1
12350 IF TOG = 8 THEN TOG = 1 : RETURN ELSE GOTO 12250
12400 PRINT CHR$(255)+I1N;
12450 PRINT CHR$(255)+I1F; CHR$(255)+I2N;
12500 PRINT CHR$(255)+I2F; CHR$(255)+I3N;
12550 PRINT CHR$(255)+I3F; CHR$(255)+I8N;
12600 PRINT CHR$(255)+I8F; CHR$(255)+I9N;
12650 PRINT CHR$(255)+I9F; CHR$(255)+I0N;
12700 PRINT CHR$(255)+I0F;
12750 RETURN
12800 '
12850 '                  DISPLAY WATTS USAGE STATUS LINE
12900 '
12950 IF LEFT$(MSG$,3) <> $$$ THEN PRINT CHR$(255)+C+CHR$(51)+CHR$(26);
13000 PRINT CHR$(255)+AE; : PRINT USING;WATTS;
13050 PRINT CHR$(255)+AA;
13100 RETURN
13150 '
13200 '                       PROGRAMPLAY INTERRUPT ?
13250 '
13300 IF D$ = I OR D$ = i THEN GOTO 24200 ELSE RETURN
13350 '$PAGE
13400 ' *********************************************************************
13450 ' *                                                                   *
13500 ' *                    B E G I N    P R O G R A M                     *
13550 ' *                                                                   *
13600 ' *********************************************************************
13650 '
13700 D$=  : WATTS=10000 : SQS=0 : GHOST=0 : SSTAR=0 : CRASHR=0 : ROM=0
13750 SSH=40 : SSV=13 : GS=0 : QUIET=0 : STAR=0 : TARGETS=0 : SEVA=0 : TOG=1
13800 SCORE=0 : G=0 : FLG1=0 : FLG2=0 : FLG4=0 : DIR=0 : FULL=0 : GEN=0
13850 BASES=0 : BH=0 : BV=0 : WATTSBASE=0 : TWATTS=10000 : GBASES=0 : UBASES=0
13900 HELP=0 : CRASHS=0 : TFLG = 0                      ' CLEAR OUT ALL DATA
13950 FOR I = 1 TO 50 : SV(I) = 27 : NEXT I             ' SET TO EMPTY STARS
14000 DIR = 1 : DIRSAV=1
14050 GOSUB 39800                                       ' GO GET FOOTER
14100 GOSUB 31850                                       ' GO SET UP TARGET
14150 H = SSH : V = SSV                                 ' START OF SCREEN
14200 ERC = SETKBDUNENCODEMODE(1)
14250 PRINT CHR$(255)+F+ +CHR$(0)+CHR$(0)+CHR$(80)+CHR$(25);
14300 IF HIT = 1 THEN GOSUB 31850                       ' GO SET UP TARGET
14350 HIT = 0 : GH = 0                                  ' TURN OFF HIT
14400 IF GEN=0 THEN GOSUB 40900 ELSE GOSUB 39800        ' GET FOOTER OR PART
14450 GOSUB 14500 : GOTO 14750
14500 IF SQS < 1 THEN RETURN                            ' RESTORE STARS IF ANY
14550 FOR SQ = 1 TO SQS
14600 IF SV(SQ) <> 27 THEN GOSUB 10750                  ' GIVE EM A STAR
14650 NEXT SQ
14700 RETURN
14750 IF GEN = 0 OR SAMPLE = 1 THEN GOTO 14900
14800 FOR Z = 1 TO 5 : GOSUB 31850 : NEXT Z             ' GIVE EM 5 GHOST SHIPS
14850 GEN = 0 : GH = 1 : GHOST = GHOST + 5 : GOSUB 40900
14900 GOSUB 10350                                       ' DISPLAY A QUIRKER
14950 IF BASES = 1 THEN GOSUB 10950                     ' DISPLAY FUEL STATION
15000 GOSUB 9550                                        ' DISPLAY STARLIGHT
15050 ERC = READKBDDIRECT(1,PTR(D$))                   ' KEYBOARD INPUT ?
15100 IF ERC = 602 AND AUTOP = 0 THEN D$ = CHR$(8)     ' NO
15150 IF WATTS > 950 THEN GOTO 15750
15200 IF WATTS > 0 THEN GOTO 15350
15250 MSG$ = * OUT OF FUEL * : ACPT = 0
15300 GOSUB 9100 : GOTO 33650
15350 IF WATTS < 751 OR FLG2 = 2 THEN GOTO 15550
15400 SMSG$ = CHR$(255)+AE+** FUEL * LOW **+CHR$(255)+AA : FLG2 = 2
15450 GOSUB 11350
15500 GOSUB 41850 : GOTO 15750
15550 IF WATTS > 250 OR FLG2 = 3 THEN GOTO 15750
15600 SMSG$ = CHR$(255)+AE+**ALERT  ALERT**+CHR$(255)+AA : FLG2 = 3
15650 GOSUB 11350
15700 GOSUB 41850
15750 IF BASES = 0 OR FLG2 = 4 THEN GOTO 15950
15800 SMSG$ = CHR$(255)+AE+*FUEL * STATION*+CHR$(255)+AA : FLG2 = 4
15850 GOSUB 11350
15900 GOSUB 41850
15950 IF DIR <> 5 THEN GOTO 16150
16000 SMSG$ = CHR$(255)+AE+PROGRAM * PAUSED+CHR$(255)+AA
16050 GOSUB 39800
16100 GOTO 16250
16150 G = G + 1
16200 IF G > 65  THEN GHOST = GHOST+1 : GOSUB 31850 : G = 0  ' A GHOST SHIP
16250 FOR DOZE = 1 TO SPEED : NEXT DOZE                 ' MACH FACTOR STALL
16300 '$PAGE
16350 '
16400 '                FIRELIGHT DIRECTION ANDOR MOVEMENT
16450 '       DIR = 1UP   DIR = 2DOWN  DIR = 3LEFT  DIR = 4RIGHT
16500 '
16550 SSSH=SSH : SSSV=SSV                               ' SAVE OLD QUADRANTS
16600 IF DIR = 5 THEN GOTO 19550
16650 SAVDIR = DIR                                      ' SAVE PRIOR DIRECTION
16700 IF FLG1 = 1 THEN GOTO 17200
16750 IF WATTS > 4999 THEN GOTO 17200                   ' USED OVER HALF FUEL ?
16800 IF TARGETS > 500 THEN GOTO 17200                  ' YES  BAD SCORE ?
16850 IF AUTOP = 1 AND AUTOF = 1 THEN GOTO 17200        ' YES  ALREADY AUTO ?
16900 ACPT = 2 : MSG$=ONE Computer system repaired : GOSUB 9100
16950 PRINT
17000 ACPT = 0 : MSG$=I WILL NOW ACTIVATE IT :  GOSUB 9150
17050 IF AUTOP = 0 THEN AUTOP = 1 ELSE AUTOF = 1
17100 FLG1 = 1
17150 GOTO 14250
17200 IF AUTOP = 1 OR AUTOF = 1 THEN GOSUB 42450        ' ANY AUTOMATIC ON
17250 IF D$=CHR$(2) OR D$=CHR$(13) OR D$=CHR$(32) THEN GOSUB 28250 ELSE GOTO 17500
17300 IF HIT = 1 THEN D$ = CHR$(9)
17350 IF HIT = 1 THEN GOSUB 18700
17400 IF HIT = 1 AND GH = 1 THEN GOTO 14250             ' CLEAR ENTIRE SCREEN
17450 IF HIT = 1 THEN GOTO 14300 ELSE GOTO 14950        ' NO
17500 IF D$ = CHR$(1)  THEN DIR = 1                     ' GO UP
17550 IF D$ = CHR$(11) THEN DIR = 2                     ' GO DOWN
17600 IF D$ = CHR$(14) THEN DIR = 3                     ' GO LEFT
17650 IF D$ = CHR$(18) THEN DIR = 4                     ' GO RIGHT
17700 '
17750 '            IT IS NOW TIME TO MOVE THE FIRELIGHT AROUND
17800 '
17850 ON DIR GOSUB 17950, 18100, 18250, 18400
17900 GOSUB 18700 : GOTO 19350
17950 IF SSV <=  0 THEN SSV = 24 : RETURN               ' WRAP AROUND
18000 IF SSV <>  0 THEN SSV = SSV  1                   ' OR GO UP     
18050 RETURN
18100 IF SSV >= 24 THEN SSV = 0  : RETURN               ' WRAP AROUND
18150 IF SSV <> 24 THEN SSV = SSV + 1                   ' OR GO DOWN    
18200 RETURN
18250 IF SSH <=  0 THEN SSH = 79 : RETURN               ' WRAP AROUND
18300 IF SSH <>  0 THEN SSH = SSH  1                   ' OR GO LEFT    
18350 RETURN
18400 IF SSH >= 79 THEN SSH = 0  : RETURN               ' WRAP AROUND
18450 IF SSH <> 79 THEN SSH = SSH + 1                   ' OR GO DOWN    
18500 RETURN
18550 '
18600 '         END OF MOVEMENT OR WRAP AROUND  HOW MUCH FUEL USED ?
18650 '
18700 IF AUTOP = 1 OR AUTOF = 1 THEN WATTS = WATTS  5 ELSE WATTS = WATTS  2
18750 IF SAVDIR = DIR THEN RETURN                   ' DIRECTION CHANGE ???
18800 IF AUTOF=1 OR AUTOP=1 THEN WATTS=WATTS  5    ' TAKE 5 SOME AUTO TRUE
18850 IF AUTOP=1 THEN WATTS = WATTS  5             ' TAKE 5 MORE AUTO PILOT
18900 IF AUTOP=0 AND AUTOF=0 THEN WATTS=WATTS3     ' MANUAL CONTROL
18950 IF BASES=1 THEN  WATTSBASE = WATTSBASE  5    ' TAKE 5 FROM FUEL STATION
19000 IF (AUTOP=1 OR AUTOF=1) AND BASES=1 THEN WATTSBASE=WATTSBASE  5
19050 IF BASES=1 AND AUTOP=1 THEN WATTSBASE = WATTSBASE  5
19100 IF DIR = 1 AND AUTOP=1 AND SSV < 24 THEN SSV = SSV+1   ' THIS IS TO STOP
19150 IF DIR = 2 AND AUTOP=1 AND SSV >  0 THEN SSV = SSV1   ' THE FIRELIGHT
19200 IF DIR = 3 AND AUTOP=1 AND SSH < 79 THEN SSH = SSH+1   ' FROM CRASHING
19250 IF DIR = 4 AND AUTOP=1 AND SSH >  0 THEN SSH = SSH1   ' WITH AUTO PILOT
19300 RETURN
19350 IF WATTS < 0 THEN GOTO 15250                           ' OUT OF FUEL 
19400 GOSUB 12950
19450 GOSUB 9550                                             ' GET FIRELIGHT
19500 IF B26 = 1 AND WATTS MOD 7 = 0 THEN GOSUB 10350
19550 GOSUB 13300                                            ' INTERRUPT ???
19600 IF DIR = 5 THEN : GOSUB 12250 : GOTO 14400
19650 '$PAGE
19700 '              QUIRKER OR STAR CRASH OR FUEL PICKUP???
19750 '
19800 CRASHP = 0 : CRASHQ = 0
19850 IF SQS < 1 THEN GOTO 20850                ' ARE THERE STARS TO CRASH INTO
19900 FOR SQ = 1 TO SQS                         ' YES
19950 IF SV(SQ) = 27 THEN GOTO 20100            ' EMPTY SLOT  NO STAR HERE
20000 IF SSH = SH(SQ) AND SSV = SV(SQ) THEN CRASHP = 1
20050 IF CRASHP = 1 THEN GOTO 20200             ' CRASHP WILL BE ON IF I DID
20100 NEXT SQ
20150 GOTO 20850                                ' NO CRASH INTO A STAR
20200 IF AUTOP = 0 THEN GOTO 20600
20250 SSSH = SSH : SSSV = SSV
20300 ON DIR GOSUB 20400,20400,20500,20500
20350 GOSUB 9550 : GOTO 19800
20400 IF SSH > 1 AND SSH < 79 THEN SSH = SSH + 1 ELSE SSH = SSH  1
20450 RETURN
20500 IF SSV > 1 AND SSV < 24 THEN SSV = SSV + 1 ELSE SSV = SSV  1
20550 RETURN
20600 SMSG$ = CHR$(255)+AE+* STAR * CRASH *+CHR$(255)+AA
20650 IF AUTOP = 1 THEN WATTS = WATTS  1000
20700 STAR=STAR+1 : CRASHS = CRASHS + 1
20750 SH(SQ)=46 : SV(SQ)=27
20800 GOTO 21050
20850 IF SSH = TH AND SSV = TV THEN CRASHQ = 1  ' DID I CRASH INTO A QUIRKER ?
20900 IF CRASHQ = 0 THEN GOTO 21750             ' CRASHQ WILL BE ON IF I DID
20950 SMSG$ = CHR$(255)+AE+QUIRKER ** CRASH+CHR$(255)+AA
21000 SCORE=SCORE+1 : CRASHR = CRASHR +1
21050 IF AUTOP = 1 OR AUTOF = 1 THEN WATTS = WATTS  1000   ' TAKE AWAY FUEL
21100 IF AUTOP = 0 AND AUTOF= 0 THEN WATTS = WATTS  800
21150 IF WATTS < 0 THEN GOTO 15250                          ' OUT OF FUEL
21200 GOSUB 11350
21250 EH=SSH : EV=SSV : M1$ =    
21300 IF SSH <>  0 THEN EH = EH  1
21350 IF SSH  = 79 THEN EH = EH  1   
21400 MSG1$ = +SS$+
21450 MSG2$=\+CHR$(22)+ : MSG3$=+CHR$(22)+\
21500 GOSUB 41200
21550 GOSUB 11550 : GOSUB 9550 ' EXPLOSION COULD BLANK OUT STARLIGHT
21600 D$ = CHR$(8)
21650 GS = 0                                           ' JUST FOR NEATNESS
21700 IF CRASHQ = 1 THEN GOSUB 31850                   ' NEED ANOTHER QUIRKER
21750 GOSUB 23350                                      ' TIME TO SHIFT ??
21800 IF BASES = 0 THEN GOTO 23000                     ' PICK UP MORE FUEL ???
21850 IF WATTSBASE > 99 THEN GOTO 22300
21900 IF FLG4 > 2 THEN GOTO 22300
21950 FLG4 = FLG4 + 1
22000 PRINT CHR$(255)+C+CHR$(BH)+CHR$(BV); ;       ' BLANK OUT OLD STATION
22050 IF BH >  0 AND BH < 40 THEN BH = BH  1          ' MOVE THE FUELING BASE
22100 IF BH > 39 AND BH < 79 THEN BH = BH + 1          ' JUST A LITTLE BIT
22150 IF BV >  0 AND BV < 13 THEN BV = BV  1          ' MAKE IT HARDER
22200 IF BV > 12 AND BV < 24 THEN BV = BV + 1
22250 GOSUB 10950                                      ' DISPLAY NEW STATION
22300 IF WATTSBASE <= 0 THEN BASES = 0 : FLG4=0
22350 IF BASES = 0 THEN PRINT CHR$(255)+C+CHR$(BH)+CHR$(BV); ; : GOTO 23000
22400 IF SSV <> BV OR SSH <> BH THEN GOTO 23000
22450 BASES = 0 : FLG4=0 : D$ =  
22500 TWATTS = TWATTS + 1000 : UBASES = UBASES + 1
22550 SMSG$ = CHR$(255)+AE+*LOADING * FUEL*+CHR$(255)+AA
22600 GOSUB 41850
22650 GOSUB 11350
22700 FOR ZZ = 1 TO 100
22750 WATTS = WATTS + 10 : GOSUB 12250                 ' LOAD FUEL BLINK LIGHTS
22800 GOSUB 12950
22850 NEXT ZZ
22900 TOG = 9 : GOSUB 12250                            ' BLACK OUT SIGN
22950 GOSUB 40900
23000 GOSUB 13300                                      ' INTERRUPT  ????
23050 GOSUB 28250                                      ' SEE ABOUT LASER FIRE
23100 IF HIT = 1 AND GH = 1 THEN GOTO 14250            ' CLEAR ENTIRE SCREEN
23150 IF HIT = 1 THEN GOTO 14300 ELSE GOTO 14950       ' NO
23200 '
23250 '               Let Quirker perform a soft shoe shuffel
23300 '
23350 ROM = ROM + 1
23400 IF ROM < 15 THEN RETURN                          ' NOT TIME YET
23450 ROM = 0                                          ' CLEAR TIMER  DO IT
23500 PRINT CHR$(255)+C+CHR$(TH)+CHR$(TV); ;       ' CLEAR OLD QUIRKER
23550 IF TH < 40 AND TH <> 0 THEN TH=TH1 : IF FIRE AND AUTOF THEN GOTO 23750
23600 IF TH > 39 AND TH < 79 THEN TH=TH+1 : IF FIRE AND AUTOF THEN GOTO 23750
23650 IF TV < 13 AND TV >  0 THEN TV=TV1 : IF FIRE AND AUTOF THEN GOTO 23750
23700 IF TV > 12 AND TV < 24 THEN TV = TV + 1
23750 IF B26 = 0 THEN GOSUB 10350 : RETURN
23800 FOR QG = 1 TO 10
23850 GOSUB 10350                                       ' DISPLAY NEW QUIRKER
23900 FOR QGG = 1 TO 15 : NEXT QGG
23950 NEXT QG
24000 RETURN
24050 '$PAGE
24100 '                 INTERRUPT PROGRAM FOR A REQUEST
24150 '
24200 ERC = SETKBDUNENCODEMODE(0)                '  IS TO CHEAT ON AUTO PILOT
24250 D$ = CHR$(8)                                '  IS TO CHEAT ON AUTO FIRE
24300 IF N$ <> LXI THEN GOTO 24850              ' TIME EXPIRED ???
24350 MSG$=SORRY  WHAT'S THE PASSWORD : ACPT = 2 : GOSUB 9100 : PRINT
24400 INPUT ENTER PASSWORD NOW: ;N$
24450 PAS = VAL(N$)
24500 IF PAS = 1961 THEN FLG3 = 1 ELSE FLG3 = 0
24550 IF FLG3 = 0 THEN GOTO 24750
24600 ERC = SETKBDUNENCODEMODE(1)
24650 PRINT CHR$(12);CHR$(255)+VF
24700 RETURN
24750 MSG$=YOU HAVE NOT PASSED  ZAP  GOODBYE : ACPT = 0 : GOSUB 9100
24800 KILL LASER.RUN : KILL LASERINST : KILL LASER.FONT : END
24850 ACPT=2 : MSG$ = Auto Fire Laser Mach Pause Help Score Quiet End
24900 PRINT CHR$(12) : FOR I = 1 TO 5 : PRINT : NEXT I
24950 GOSUB 9150 : PRINT
25000 PRINT TAB(15)Auto:  ActivateDeactivate AUTO PILOT CONTROL.
25050 PRINT TAB(15)Fire:  ActivateDeactivate AUTO FIRE CONTROL.
25100 PRINT TAB(15)Laser: Alters Laser power to FULL or HALF power.
25150 PRINT TAB(15)Mach:  IncreaseDecrease your SPEED (MACH 19 0).
25200 PRINT TAB(15)Pause: STOPSTART (PAUSE) Action screen displayed.
25250 PRINT TAB(15)Help:  Defines program operation (FILE LASERINST).
25300 PRINT TAB(15)Score: Displays your current score and other data.
25350 PRINT TAB(15)Quiet: CRASH, LASER HIT or STAR EVASION BEEPS. ON or OFF.
25400 PRINT TAB(15)End:   ENDOFJOB  and let's you start a new game.
25450 ACPT=1 : PRINT : MSG$ = ENTER FIRST LETTER ONLY +PLAYER$
25500 GOSUB 9150
25550 IF N$ = A OR N$ = F OR N$ = L OR N$ = M OR N$ = S OR N$ = Q OR N$ = E OR N$ = H OR N$ = P OR N$ =  OR N$ =  THEN GOTO 25800
25600 ACPT = 0 : MSG$=INVALID REQUEST OF: +N$+ +PLAYER$ : GOSUB 9100
25650 GOTO 24850
25700 ACPT = 0 : MSG$=I DON'T UNDERSTAND: +N$+ +PLAYER$ : GOSUB 9100
25750 RETURN
25800 IF N$  = S THEN GOTO 33650
25850 IF N$ <> P THEN GOTO 26100
25900 IF REST = 0 THEN REST = 1 ELSE REST = 0
25950 IF REST = 1 THEN DIRREST = DIR ELSE DIR = DIRREST
26000 IF REST = 1 THEN DIR = 5
26050 GOTO 27950
26100 IF N$ <> Q THEN GOTO 26300
26150 ACPT=1 : MSG$=Attack in quiet mode YN : GOSUB 9100
26200 IF N$ = Y THEN QUIET = 1 ELSE QUIET = 0
26250 GOTO 27950
26300 IF N$ <> A AND N$ <>  THEN GOTO 26850
26350 IF AUTOP = 1 OR N$ =  THEN GOTO 26650
26400 IF TARGETS > 249 THEN GOTO 26650
26450 ACPT = 2 : MSG$ = 1st OFFICER reports AUTO PILOT DAMAGED
26500 GOSUB 9100 : PRINT
26550 ACPT = 0 : MSG$ = PLAYER$+? It may work later.
26600 GOSUB 9150 : GOTO 27950
26650 ACPT = 1 : MSG$ = Auto Pilot ON YN : GOSUB 9100
26700 IF N$ <> Y AND N$ <> N THEN GOSUB 25700 : GOTO 26650
26750 IF N$ = Y THEN AUTOP = 1 ELSE AUTOP = 0
26800 GOTO 27950
26850 IF N$ <> F AND N$ <>  THEN GOTO 27400
26900 IF AUTOF = 1 OR N$ =  THEN GOTO 27200
26950 IF TARGETS > 399 THEN GOTO 27200
27000 ACPT = 2 : MSG$ = 2nd OFFICER reports FIRE CONTROL DAMAGE
27050 GOSUB 9100 : PRINT
27100 ACPT = 0 : MSG$ = PLAYER$+? It may work later.
27150 GOSUB 9150 : GOTO 27900
27200 ACPT = 1 : MSG$ = Auto Fire Control ON YN : GOSUB 9100
27250 IF N$ <> Y AND N$ <> N THEN GOSUB 25700 : GOTO 27200
27300 IF N$ = Y THEN AUTOF = 1 ELSE AUTOF = 0
27350 GOTO 27950
27400 IF N$  = E THEN GOTO 34300
27450 IF N$ <> L THEN GOTO 27650
27500 ACPT=1 : MSG$ = Laser FULL or HALF POWER FH : GOSUB 9100
27550 IF N$ <> F AND N$ <> H THEN GOSUB 25700 : GOTO 27500
27600 IF N$  = F THEN FULL = 1 ELSE FULL = 0 : N$ =  
27650 IF N$ <> M THEN GOTO 27900
27700 ACPT=2 : MSG$ = ENTER NEW MACH SPEED FROM 19, 0 : GOSUB 9100 : PRINT
27750 ACPT = 1 : MSG$ = REMEMBER 0 IS FASTER THAN MACH 9 : GOSUB 9150
27800 MACH = VAL(N$) : WRP$ = N$
27850 IF MACH = 0 THEN SPEED = 1 ELSE SPEED = 450MACH
27900 IF N$ = H THEN HELP = 1 : GOTO 6150
27950 HELP = 0
28000 D$ = CHR$(8) : N$ =  
28050 GOTO 14250                     ' CONTINUE PROGRAM GO RENEW SCREEN DISPLAY
28100 '$PAGE
28150 '                            FIRE LASERS ?
28200 '
28250 IF D$ <> CHR$(2) AND D$ <> CHR$(13) AND D$ <> CHR$(32) THEN RETURN ' NO
28300 H = SSH : V = SSV : D$ = CHR$(9) : HH=TH : VV=TV : FIRE = 1
28350 IF B26 = 0 THEN GOTO 28650
28400 IF DIR = 1 THEN LASER$ = CHR$(130)
28450 IF DIR = 2 THEN LASER$ = CHR$(131)
28500 IF DIR = 3 THEN LASER$ = CHR$(132)
28550 IF DIR = 4 THEN LASER$ = CHR$(133)
28600 GOTO 28750
28650 IF DIR = 1 OR DIR = 2 THEN LASER$ = CHR$(225)
28700 IF DIR = 3 OR DIR = 4 THEN LASER$ = 
28750 ON DIR GOSUB 28950, 29600, 30250, 30900
28800 D$ = CHR$(9) : FIRE = 0
28850 IF HIT = 1 AND TV MOD 5 = 0 THEN GEN = 1 ELSE GEN = 0
28900 RETURN
28950 WHILE (V <> 0)                                     ' FIRE UP
29000 V = V  1 : GOSUB 11150                            ' GO FIRE
29050 IF V MOD 5 = 0 THEN GOSUB 23350                    ' MOVE TARGET ?
29100 WATTS = WATTS  1 : GOSUB 31550                    ' DISPLAY FUEL
29150 GOSUB 37750                                        ' HIT ANYTHING
29200 IF (HIT=0 AND B26=1) AND WATTS MOD 7 = 0 THEN GOSUB 10350
29250 GOSUB 13300                                        ' INTERRUPT ?
29300 IF HIT = 1 THEN V = 0                              ' STOP FIRING A HIT
29350 IF FULL=0 AND V1 < VV AND AUTOF=0 THEN V=0        ' THERE  HALF POWER
29400 IF AUTOF = 1 AND H <> TH THEN V = 0                ' AUTOF  TARGET MOVED
29450 IF D$=CHR$(2) OR D$=CHR$(13) OR D$=CHR$(32) THEN V = 0  ' MANUAL STOP
29500 WEND
29550 RETURN
29600 WHILE (V <> 24)                                    ' FIRE DOWN
29650 V = V + 1 : GOSUB 11150                            ' GO FIRE
29700 IF V MOD 5 = 0 THEN GOSUB 23350                    ' MOVE TARGET ?
29750 WATTS = WATTS  1 : GOSUB 31550
29800 GOSUB 37750                                        ' HIT ANYTHING
29850 IF (HIT=0 AND B26=1) AND WATTS MOD 7 = 0 THEN GOSUB 10350
29900 GOSUB 13300                                        ' INTERRUPT ?
29950 IF HIT = 1 THEN V = 24                             ' STOP FIRING A HIT
30000 IF FULL=0 AND V+1 > VV AND AUTOF=0 THEN V=24       ' THERE  HALF POWER
30050 IF AUTOF = 1 AND H <> TH THEN V = 24               ' AUTOF  TARGET MOVED
30100 IF D$=CHR$(2) OR D$=CHR$(13) OR D$=CHR$(32) THEN V = 24 ' MANUAL STOP
30150 WEND
30200 RETURN
30250 WHILE (H <> 0)                                     ' FIRE LEFT
30300 H = H  1 : GOSUB 11150                            ' GO FIRE
30350 IF H MOD 15 = 0 THEN GOSUB 23350                   ' MOVE TARGET ?
30400 WATTS = WATTS  1 : GOSUB 31550
30450 GOSUB 37750                                        ' HIT ANYTHING
30500 IF (HIT=0 AND B26=1) AND WATTS MOD 7 = 0 THEN GOSUB 10350
30550 GOSUB 13300                                        ' INTERRUPT ?
30600 IF HIT = 1 THEN H = 0                              ' STOP FIRING A HIT
30650 IF FULL=0 AND H1 < HH AND AUTOF=0 THEN H=0        ' THERE  HALF POWER
30700 IF AUTOF = 1 AND V <> TV THEN H = 0                ' AUTOF  TARGET MOVED
30750 IF D$=CHR$(2) OR D$=CHR$(13) OR D$=CHR$(32) THEN H = 0 ' MANUAL STOP
30800 WEND
30850 RETURN
30900 WHILE (H <> 79)                                    ' FIRE RIGHT
30950 H = H + 1 : GOSUB 11150                            ' GO FIRE
31000 IF H MOD 15 = 0 THEN GOSUB 23350                   ' MOVE TARGET ?
31050 WATTS = WATTS  1 : GOSUB 31550
31100 GOSUB 37750                                        ' HIT ANYTHING
31150 IF (HIT=0 AND B26=1) AND WATTS MOD 7 = 0 THEN GOSUB 10350
31200 GOSUB 13300                                        ' INTERRUPT ?
31250 IF HIT = 1 THEN H = 79                             ' STOP FIRING A HIT
31300 IF FULL=0 AND H+1 > HH AND AUTOF=0 THEN H=79       ' THERE  HALF POWER
31350 IF AUTOF = 1 AND V <> TV THEN H = 79               ' AUTOF  TARGET MOVED
31400 IF D$=CHR$(2) OR D$=CHR$(13) OR D$=CHR$(32) THEN H = 79 ' MANUAL STOP
31450 WEND
31500 RETURN
31550 IF WATTS < 0 THEN GOTO 15250                       ' OUT OF FUEL
31600 GOSUB 12950                                        ' DISPLAY FUEL
31650 RETURN
31700 '$PAGE
31750 '         GENERATE RANDOM QUIRKERS, STARS OR REFUELING BASE
31800 '
31850 IF TARGETS MOD 150 <> 0 OR TARGETS = 0 OR BASES = 1 THEN GOTO 32200
31900 IF CRASHR+CRASHS <= GBASES THEN GOTO 32200         ' NO MORE THAN NEEDED
31950 NUM = RND : QUAD = INT(NUM*1920)                   ' A NUMBER 1 TO 1920
32000 BV = INT(QUAD80)
32050 BH = QUAD(BV*80)
32100 BASES = 1 : WATTSBASE=200 : GBASES = GBASES + 1
32150 GOSUB 10950                                        ' DISPLAY FUEL BASE
32200 NUM = RND : QUAD = INT(NUM*1920)
32250 IF GS = 0 THEN TV = INT(QUAD80) ELSE SVS = INT(QUAD80)
32300 IF GS = 0 THEN TH = QUAD(TV*80) ELSE SHS = QUAD(SVS*80)
32350 IF AUTOP = 0 THEN GOTO 32600                ' AUTO PILOT NOT ON
32400 IF GS = 1 THEN GOTO 32550                   ' GENERATING A STAR =1 YES
32450 IF SSV = TV AND SSH = TH THEN GOTO 32200    ' DON'T GENERATE ON TOP OF ME
32500 GOTO 32600                                  ' IF AUTO PILOT IS ON
32550 IF SSV = SVS AND SSH = SHS THEN GOTO 32200  ' SAME AS ABOVE
32600 IF TV > 24 OR SVS > 24 THEN GOTO 32200      ' A LITTLE PROTECTION FROM
32650 IF TH > 79 OR SHS > 79 THEN GOTO 32200      ' A SYSTEM FATALITY
32700 IF GS=1 THEN : SSTAR=SSTAR+1 : GOTO 33050   ' STAR GENERATION ?
32750 GOSUB 10350                                  ' NO DISPLAY A QUIRKER
32800 TARGETS = TARGETS + 1
32850 IF TV = 12 AND TH < 30 THEN GOTO 32950      ' RANDOM STAR TV=12  TH30
32900 IF TARGETS MOD 50 <> 0 THEN GOTO 33350      ' TARGETS MOD 50 A STAR
32950 GS = 1                                      ' GENERATE A STAR
33000 GOTO 32200
33050 GS=0
33100 FOR SQ = 1 TO 50
33150 IF SV(SQ) = 27 THEN SV(SQ)=SVS : SH(SQ)=SHS : GOTO 33250
33200 NEXT SQ
33250 IF SQ > SQS THEN SQS = SQ
33300 GOSUB 10750 : GOSUB 41200                   ' DISPLAY A STAR
33350 IF TARGETS > 20 AND SAMPLE=1 THEN GOTO 8300 ' END SAMPLE RUN
33400 IF GEN = 0 THEN GOSUB 40900
33450 IF TARGETS < 1000 THEN RETURN
33500 '$PAGE
33550 '                  SCORE REQUEST    OR GAME OVER
33600 '
33650 ERC=SETKBDUNENCODEMODE(0)
33700 IF N$ = S OR N$ = s THEN GOTO 34300     ' SCORE REQUEST SKIP BELOW
33750 PRINT CHR$(12);
33800 FOR I = 1 TO 11 : PRINT : NEXT I
33850 PRINT TAB(27);
33900 PRINT TAB(27);                         
33950 PRINT TAB(27); ;CHR$(255)+AE;
34000 IF TARGETS >= 1000 THEN PRINT QUIRKER EMPIRE DEFEATED;CHR$(255)+AA;
34050 IF TARGETS <  1000 THEN PRINT YOU LOST THE FIRELIGHT;CHR$(255)+AA;
34100 PRINT  
34150 PRINT TAB(27);                         
34200 PRINT TAB(27);
34250 FOR I = 1 TO 9000 : NEXT I
34300 PRINT CHR$(12);
34350 PRINT : MSG$=S C O R I N G : PRINT TAB((80LEN(MSG$))2);MSG$
34400 PRINT STRING$(79,)
34450 PRINT The IDEAL scoring is for the largest number of Quirkers destroyed using the
34500 PRINT lowest amount of fuel per Quirker and the largest amount of fuel left over.
34550 PRINT If you completed 1,000 Quirkers or you ran OUT OF FUEL you will be RANKED as:
34600 PRINT * ENSIGN, LIEUTENANT JG., LIEUTENANT, COMMANDER, CAPTAIN, ADMIRAL OR WIZARD. *
34650 PRINT The COMPUTER attained the rank of WIZARD many times, with FULL AUTOMATIC ON.
34700 PRINT STRING$(79,) : PRINT
34750 IF SCORE <> 0 THEN ZZ = ((TWATTSWATTS)SCORE) ELSE ZZ = TWATTSWATTS
34800 IF N$ = S OR N$ = E THEN GOTO 35400
34850 RMSG$ = BUCK PRIVATE +PLAYER$                ' DEFAULT TO BUCK PRIVATE
34900 IF ZZ < 150 THEN RMSG$ = ENSIGN +PLAYER$
34950 IF ZZ < 100 THEN RMSG$ = LIEUTENANT JG. +PLAYER$
35000 IF ZZ < 70  THEN RMSG$ = LIEUTENANT +PLAYER$
35050 IF ZZ < 40  THEN RMSG$ = COMMANDER +PLAYER$
35100 IF ZZ < 20  THEN RMSG$ = CAPTAIN +PLAYER$
35150 IF ZZ < 10  THEN RMSG$ = ADMIRAL +PLAYER$
35200 IF ZZ <  5  THEN RMSG$ = WIZARD +PLAYER$
35250 IF ZZ <= 1  THEN RMSG$ = * * * G O D * * *
35300 MSG$=CHR$(255)+AE+RMSG$+CHR$(255)+AA : NMSG$ = YOUR TOTALS ARE:
35350 GOTO 35500
35400 MSG$ = CHR$(255)+AE+PLAYER$+CHR$(255)+AA
35450 NMSG$ = YOUR TOTALS SO FAR ARE:
35500 PRINT TAB((80LEN(MSG$))2);  ;MSG$
35550 PRINT TAB((80LEN(NMSG$))2);NMSG$ : PRINT
35600 PRINT Quirkers Total: ; : PRINT USING;TARGETS;
35650 PRINT    Destroyed: ; : PRINT USING ;SCORE;
35700 PRINT    Ghosts: ; : PRINT USING ; GHOST;
35750 PRINT    Vanished: ; : PRINT USING;TARGETS(SCORE+GHOST) 
35800 PRINT Stars Total:      ; : PRINT USING;SSTAR;
35850 PRINT    Destroyed:  ; : PRINT USING ; STAR;
35900 PRINT    Left:    ; : PRINT USING;SSTARSTAR;
35950 PRINT USING   Evaded:  ;SEVA : PRINT
36000 PRINT Collisions:  Quirkers: ;
36050 PRINT USING;CRASHR; : PRINT    Stars: ; : PRINT USING;CRASHS
36100 PRINT
36150 PRINT USINGFuel Bases Generated:   ;GBASES;
36200 PRINT USING   Used:   ;UBASES
36250 PRINT USINGTOTAL FUEL:         ;TWATTS
36300 PRINT Fuel Units Left:    ;CHR$(255)+AE;
36350 PRINT USING;WATTS; : PRINT CHR$(255)+AA;
36400 PRINT   COST:  ;CHR$(255)+AE;
36450 PRINT USING ;ZZ; : PRINT CHR$(255)+AA;
36500 PRINT  FUEL UNITS PER QUIRKER : PRINT
36550 PRINT PLAYER$; You have been in space for ;
36600 PRINT USING;ETIME; : PRINT  LIGHT YEARS.
36650 IF N$ <> S THEN GOTO 36850
36700 PRINT : PRINT CONTINUE THIS GAME YN ;
36750 N$=INPUT$(1)
36800 IF N$ <> N AND N$ <> n THEN GOTO 27900
36850 PRINT : PRINT PLAY AGAIN YN ;
36900 N$=INPUT$(1)
36950 IF ZZ > 0 OR TARGETS < 1000 THEN GOTO 37450
37000 PRINT CHR$(12);CHR$(255)+VF;
37050 FOR I = 1 TO 12 : PRINT : NEXT I
37100 MSG$ = PLAYER$+  YOUR'E GOD, YOU CAN'T DO BETTER
37150 PRINT TAB((80LEN(MSG$))2);MSG$;
37200 FOR I = 1 TO 10
37250 PRINT CHR$(255)+RN; : FOR G = 1 TO 1000 : NEXT G
37300 PRINT CHR$(255)+RF; : FOR G = 1 TO 1000 : NEXT G
37350 NEXT I
37400 END
37450 AUTOP = 0 : AUTOF = 0 : DIR = 0 ' AUTO PILOT  FIRE OFF  STOP FIRELIGHT
37500 IF N$ = Y OR N$ = y THEN GOTO 5950
37550 END
37600 '$PAGE
37650 '         HIT = 1 = QUIRKER HIT       SHIT = 1 = STAR HIT
37700 '
37750 IF H = TH AND V = TV THEN HIT = 1 ELSE HIT = 0   ' HIT A QUIRKER HIT = 1
37800 SHIT = 0                                         ' RESET STAR HIT
37850 PRINT CHR$(255)+C+CHR$(H)+CHR$(V); ;         ' CLEAR LASER SHOT
37900 ERC = READKBDDIRECT(1,PTR(D$)) 
37950 IF SQS < 1 THEN GOTO 38550
38000 FOR SQ = 1 TO SQS+1
38050 IF SV(SQ) = 27 THEN GOTO 38500                   ' EMPTY SLOT  NO STAR
38100 IF H = SH(SQ) AND V = SV(SQ) THEN SHIT = 1       ' HIT A STAR   SHIT = 1
38150 IF SHIT = 0 THEN GOTO 38500
38200 IF FULL = 1 THEN WATTS = WATTS  125 ELSE WATTS = WATTS  100  
38250 STAR = STAR + 1
38300 TVS=TV : THS=TH : TH=H : TV=V : SH(SQ)=46 : SV(SQ)=27
38350 SMSG$ = CHR$(255)+AF+LASER HIT A STAR+CHR$(255)+AA
38400 GOSUB 41850
38450 IF HIT = 1 THEN GOTO 38600 ELSE GOTO 38850
38500 NEXT SQ
38550 IF HIT = 0 THEN RETURN      ' NO QUIRKER  NO STAR HIT  GET OUT OF HERE
38600 SCORE = SCORE + 1
38650 WATTS = WATTS + 100
38700 IF SHIT = 0 THEN GOTO 38850
38750 SMSG$=CHR$(255)+AE+HIT QUIRK  STAR+CHR$(255)+AA
38800 GOSUB 41850
38850 EH=TH : EV=TV : M1$ =    
38900 IF TH <> 0 THEN EH = EH  1
38950 IF TH = 79 THEN EH = EH  1   
39000 IF HIT = 1 THEN MSG1$ = +Q$+ ELSE MSG1$ = *
39050 MSG2$ = \+CHR$(22)+ : MSG3$ = +CHR$(22)+\
39100 GOSUB 11550 : GOSUB 12950                            ' GO EXPLODE
39150 IF SHIT = 0 THEN GOTO 39250
39200 TV = TVS : TH = THS : GOSUB 41200 : GOSUB 10350       ' RESTORE QUIRKER
39250 GOSUB 14500                                          ' RESTORE STARS
39300 GOSUB 9550                                           ' RESTORE STAR LIGHT
39350 IF FULL = 1 THEN RETURN
39400 IF DIR  = 1 THEN V =  0                              ' STOP FIRING
39450 IF DIR  = 2 THEN V = 24                              ' IF NOT FULL    
39500 IF DIR  = 3 THEN H =  0                              ' LASER POWER
39550 IF DIR  = 4 THEN H = 79
39600 RETURN
39650 '$PAGE
39700 '                    * * *  GET STAR DATE  * * *
39750 '
39800 A = 0 : B = 0 : STARDATE$ = STRING$(31, )
39850 ERC = GETDATETIME(PTR(A))
39900 ERC = EXPANDDATETIME(A,PTR(B))
39950 ERC = FORMATTIME(PTR(STARDATE$),PTR(B))
40000 IF MID$(STARDATE$,11,1) = , THEN Y = VAL(MID$(STARDATE$,13,4))
40050 IF MID$(STARDATE$,12,1) = , THEN Y = VAL(MID$(STARDATE$,14,4))
40100 INST = INSTR(STARDATE$,:)
40150 HR = VAL(MID$(STARDATE$,INST2,2))        ' GET HOUR
40200 MN = VAL(MID$(STARDATE$,INST+1,2))        ' GET MIN
40250 IF TFLG = 1 THEN GOTO 40350
40300 SHR = HR : SMN = MN : STIME = (HR*60)+MN : TFLG = 1  ' STORE START TIME
40350 IF HR < SHR THEN HR = HR + 12             ' NOON OR MIDNIGHT CROSSOVER ?
40400 NTIME = (HR*60)+MN
40450 ETIME = NTIMESTIME                       ' ELAPSED TIME IN MINUTES
40500 IF ETIME < 30 THEN GOTO 40700             ' LESS THAN 30 IS OK
40550 LTIME$ = STR$(ETIME) : ACPT = 0
40600 MSG$=PLAYER$+ You've been LOST IN SPACE for +LTIME$+ LIGHT YEARS
40650 GOSUB 9100 : GOSUB 33650
40700 IF Y > 1986 AND FLG3 = 0 THEN N$ = LXI : GOSUB 24200
40750 YR = Y + 1961                           ' 10+23+1928 MY BIRTH DATE = 1961
40800 IF MID$(STARDATE$,11,1) = , THEN MID$(STARDATE$,12,5) = STR$(YR)
40850 IF MID$(STARDATE$,12,1) = , THEN MID$(STARDATE$,13,5) = STR$(YR)
40900 IF DIR = 5 THEN GOTO 41150
40950 SMSG$=MANUAL * CONTROL                          ' DEFAULT TO MANUAL
41000 IF AUTOP=1 AND AUTOF=1 THEN SMSG$=AUTO  PILOTFIRE
41050 IF AUTOP=1 AND AUTOF=0 THEN SMSG$=  AUTO  PILOT   
41100 IF AUTOP=0 AND AUTOF=1 THEN SMSG$=  AUTO   FIRE   
41150 IF FULL = 0 THEN LAS$ = HALF ELSE LAS$ = FULL
41200 IF LEFT$(MSG$,3) <> $$$ THEN PRINT CHR$(255)+C+CHR$(0)+CHR$(25);
41250 PRINT CHR$(255)+AE;PLAYER$;CHR$(255)+AA;
41300 PRINT   CREATED ;CHR$(255) +AF; 
41350 PRINT USING ;TARGETS; : PRINT CHR$(255)+AA; ;QQ$;
41400 PRINT   HIT ;CHR$(255)+AF;
41450 PRINT USING ;SCORE;
41500 PRINT CHR$(255)+AA; ;Q$;  CREATED ;CHR$(255)+AF;
41550 PRINT USING ;SSTAR;
41600 PRINT CHR$(255)+AA; *  HIT ;CHR$(255)+AF;
41650 PRINT USING ;STAR;
41700 PRINT CHR$(255)+AA; *  LASER ;
41750 IF B26=0 THEN PRINT LAS$; ELSE PRINT CHR$(255)+AF;LAS$;CHR$(255)+AA;
41800 IF LEFT$(MSG$,3) = $$$ THEN PRINT
41850 IF LEFT$(MSG$,3) <> $$$ THEN PRINT CHR$(255)+C+CHR$(0)+CHR$(26);
41900 IF B26=1 THEN PRINT CHR$(138); STAR DATE ;MID$(STARDATE$,2,25);
41950 IF B26=0 THEN PRINT   STAR DATE ;MID$(STARDATE$,2,25);
42000 PRINT  MACH ;
42050 PRINT CHR$(255)+AF;WRP$;CHR$(255)+AA;
42100 PRINT   FUEL ;
42150 GOSUB 12950
42200 PRINT TAB(59);SMSG$;
42250 RETURN
42300 '$PAGE
42350 '                       FIRE CONTROL ACTIVE ?
42400 '
42450 IF AUTOP = 0 OR TV <> SSV THEN GOTO 42750  ' AUTO PILOT OFF OR NOT VERT
42500 IF TH > SSH THEN ZH = TH  SSH ELSE ZH = SSH  TH    ' GET DIFFERENCE
42550 IF ZH < 63 THEN GOTO 42750                           ' GRT THAN 70 ??
42600 IF TH < SSH AND TH  >  1 THEN DIR = 4 : RETURN       ' WRAP RIGHT
42650 IF TH > SSH AND TH  < 78 THEN DIR = 3 : RETURN       ' WRAP LEFT
42700 '
42750 IF AUTOF = 0 THEN GOTO 43200             ' FIRE CONTROL INACTIVE = BRANCH
42800 '
42850 IF (TV = SSV AND DIR = 4) AND TH > SSH THEN D$ = CHR$(2) : RETURN
42900 IF (TV = SSV AND DIR = 3) AND TH < SSH THEN D$ = CHR$(2) : RETURN
42950 IF (TH = SSH AND DIR = 1) AND TV < SSV THEN D$ = CHR$(2) : RETURN
43000 IF (TH = SSH AND DIR = 2) AND TV > SSV THEN D$ = CHR$(2) : RETURN
43050 '
43100 '                        AUTO PILOT ACTIVE ?
43150 '
43200 IF AUTOP = 0 THEN RETURN                 ' AUTO PILOT INACTIVE = RETURN
43250 '$PAGE
43300 '              AUTO PILOT ACTIVE  PERFORM STAR EVASION
43350 '
43400 TESTER = DIR
43450 IF SQS < 1 THEN GOTO 45300
43500 FOR SQ = 1 TO SQS
43550 IF SV(SQ) = 27 THEN GOTO 45100                      ' EMPTY SLOT SKIP IT
43600 '
43650 '  LOOK AHEAD   UP   DOWN   LEFT  RIGHT
43700 '
43750 ON DIR GOSUB 43850, 44050, 44250, 44450
43800 GOTO 44650
43850 IF SSV <> 0 THEN GOTO 43950                         ' TOP OF SCREEN ?
43900 IF (SV(SQ)=24 AND SSH=SH(SQ)) THEN IF SSH > 0 THEN DIR=3 ELSE DIR=4
43950 IF (SSV1=SV(SQ)) AND (SSH=SH(SQ)) THEN IF SSH > 0 THEN DIR=3 ELSE DIR=4
44000 RETURN    
44050 IF SSV <> 24 THEN GOTO 44150                        ' BOTTOM OF SCREEN ?
44100 IF (SV(SQ)=0  AND SSH=SH(SQ)) THEN IF SSH > 0 THEN DIR=3 ELSE DIR=4
44150 IF (SSV+1=SV(SQ)) AND (SSH=SH(SQ)) THEN IF SSH > 0 THEN DIR=3 ELSE DIR=4
44200 RETURN     
44250 IF SSH <> 0 THEN GOTO 44350                         ' LEFT SIDE ?
44300 IF (SH(SQ)=79 AND SSV=SV(SQ)) THEN IF SSV > 0 THEN DIR=1 ELSE DIR=2
44350 IF (SSH1=SH(SQ)) AND (SSV=SV(SQ)) THEN IF SSV > 0 THEN DIR=1 ELSE DIR=2
44400 RETURN     
44450 IF SSH <> 79 THEN GOTO 44550                        ' RIGHT SIDE ?
44500 IF (SH(SQ)=0  AND SSV=SV(SQ)) THEN IF SSV > 0 THEN DIR=1 ELSE DIR=2
44550 IF (SSH+1=SH(SQ)) AND (SSV=SV(SQ)) THEN IF SSV > 0 THEN DIR=1 ELSE DIR=2
44600 RETURN
44650 IF TESTER = DIR THEN GOTO 45100                     ' EQUAL NO EVASION
44700 SMSG$=CHR$(255)+AE+*STAR * EVASION*+CHR$(255)+AA : SEVA = SEVA + 1
44750 GOSUB 11350
44800 GOSUB 41850
44850 IF DIR = 1 THEN SSV = SSV1                         ' EVADE THE STARS
44900 IF DIR = 2 THEN SSV = SSV+1                         ' THERE WAS ONE
44950 IF DIR = 3 THEN SSH = SSH1                         ' IN MY WAY  
45000 IF DIR = 4 THEN SSH = SSH+1                         ' DO A SIDE STEP
45050 RETURN
45100 NEXT SQ
45150 '$PAGE
45200 '                AUTO PILOT ACTIVE  BEGIN THE CHASE
45250 '
45300 ZV=TVSSV                                ' TARGET VERT QUAD ??
45350 ZH=THSSH                                ' TARGET HORZ QUAD ??
45400 IF ZV <> 0 THEN GOTO 45550               ' NOT THE SAME VERTICAL LINE
45450 IF ZH <  0 THEN DIR=3 : GOSUB 9550 : RETURN
45500 IF ZH >  0 THEN DIR=4 : GOSUB 9550 : RETURN
45550 IF ZH <> 0 THEN GOTO 45850               ' NOT SAME HORZ LINE
45600 IF ZV <  0 THEN DIR=1 : GOSUB 9550 : RETURN
45650 IF ZV >  0 THEN DIR=2 : GOSUB 9550 : RETURN
45700 '
45750 ' IF TARGET WAS ON SAME VERTICAL OR HORIZONTAL LINES I JUST TURNED
45800 '
45850 IF ZV < 0 THEN GOTO 46950                ' IF TARGET IS ABOVE THEN BRANCH
45900                                          ' TARGET IS BELOW        
45950 IF ZH < 0 THEN GOTO 46550                ' AND IS IT LEFT = BRANCH
46000 '
46050 '        TARGET IS BELOW AND TO THE RIGHT 
46100 '
46150 IF ZV > 13 AND (ZH > 20 AND ZH < 60) THEN DIR=1 : RETURN   ' WRAP UP
46200 IF ZH > 70 THEN DIR = 3 : RETURN                           ' WRAP LEFT
46250 IF ZH > 60 AND  ZV > 10 THEN DIR = 3 : RETURN              ' WRAP LEFT
46300 IF ZV < ZH THEN DIR = 2 : RETURN                           ' GO DOWN
46350 DIR = 4 : RETURN                                           ' GO RIGHT
46400 '
46450 '        TARGET IS BELOW AND TO THE LEFT  
46500 '
46550 ZH = SSHTH                              ' CORRECT FOR NEGATIVE NUMBER
46600 IF ZV > 13 AND (ZH > 20 AND ZH < 60) THEN DIR=1 : RETURN   ' WRAP UP
46650 IF ZH > 70 THEN DIR = 4 : RETURN                           ' WRAP RIGHT
46700 IF ZH > 60 AND  ZV > 10 THEN DIR = 4 : RETURN              ' WRAP RIGHT
46750 IF ZV < ZH THEN DIR = 2 : RETURN                           ' GO DOWN
46800 DIR = 3 : RETURN                                           ' GO LEFT
46850 '
46900 '          TARGET IS ABOVE  
46950 ZV = SSVTV                              ' ABOVE CORRECT NEGATIVE
47000 IF ZH < 0 THEN GOTO 47600                ' IF TARGET IS LEFT THEN BRANCH
47050 '
47100 '        TARGET IS ABOVE AND TO THE RIGHT 
47150 '
47200 IF ZV > 13 AND (ZH > 20 AND ZH < 60) THEN DIR=2 : RETURN   ' WRAP DOWN
47250 IF ZH > 70 THEN DIR = 3 : RETURN                           ' WRAP LEFT
47300 IF ZH > 60 AND  ZV > 10 THEN DIR = 3 : RETURN              ' WRAP LEFT
47350 IF ZV < ZH THEN DIR = 1 : RETURN                           ' GO UP
47400 DIR = 4 : RETURN                                           ' GO RIGHT
47450 '
47500 '        TARGET IS ABOVE AND TO THE LEFT 
47550 '
47600 ZH = SSHTH                              ' CORRECT NEGATIVE NUMBER
47650 IF ZV > 13 AND (ZH > 20 AND ZH < 60) THEN DIR=2 : RETURN   ' WRAP DOWN
47700 IF ZH > 70 THEN DIR = 4                                    ' WRAP RIGHT
47750 IF ZH > 60 AND  ZV > 10 THEN DIR = 4 : RETURN              ' WRAP RIGHT
47800 IF ZV < ZH THEN DIR = 1 : RETURN                           ' GO UP
47850 DIR = 3 : RETURN                                           ' GO LEFT
