-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSUPERSTARTREK.BAS
688 lines (688 loc) · 28 KB
/
SUPERSTARTREK.BAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
10 REM ** SUPER STAR TREK
20 REM ** BY MIKE MAYFIELD 1974
30 REM ** MODIFIED BY DAVID AHL 1978
40 REM ** CONVERTED TO 40 COLUMNS
50 REM ** BY ELECTRON.GREG 2022-2023
60 REM ** BBC MICRO VERSION
70 CLEAR
80 VER$="V3.0h 31/5/2023 08:58"
90 GOSUB 6500
100 FOR N=1 TO 19:PRINT:NEXT
110 PRINT HCOL$;" --S-U-P-E-R---S-T-A-R---T-R-E-K--"
120 FOR N=1 TO 5:PRINT:NEXT
130 PRINT" ,------*------,"
140 PRINT" ,------------- '--- ------'"
150 PRINT" '-------- --' / /"
160 PRINT" ,---' '-------/ /--,"
170 PRINT" '----------------'":PRINT
180 PRINT DCOL$;" THE USS ENTERPRISE --- NCC-1701"
190 FOR N=1 TO 7:PRINT:NEXT:CRSTART=1:PRINT ICOL$;VER$:PRINT:GOSUB 6020
200 X9=RND(-TIME)
210 PRINT:PRINT "GENERATING GALAXY";
220 Z$=" "
230 DIM G(8,8),C(9,2),K(3,3),N(3),Z(8,8),D(8)
240 T=INT(RND(1)*20+20)*100:T0=T:T9=25+INT(RND(1)*10):D0=0:E=3000:E0=E
250 P=10:P0=P:S9=200:S=0:B9=2:K9=0:X$="":X0$=" IS "
260 DEF FND(D)=SQR((K(I,1)-S1)^2+(K(I,2)-S2)^2)
270 DEF FNR(R)=INT(RND(R)*7.98+1.01)
280 REM INITIALIZE ENTERPRISE'S POSITION
290 Q1=FNR(1):Q2=FNR(1):S1=FNR(1):S2=FNR(1)
300 FOR I=1 TO 9:C(I,1)=0:C(I,2)=0:NEXT I
310 C(3,1)=-1:C(2,1)=-1:C(4,1)=-1:C(4,2)=-1:C(5,2)=-1:C(6,2)=-1
320 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
330 FOR I=1 TO 8:D(I)=0:NEXT I
340 A1$="NAVSRSLRSPHATORSHEDAMCOMXXX"
350 REM SETUP WHAT EXISTS IN GALAXY . . .
360 REM K3= # KLINGONS B3= # STARBASES S3 = # STARS
370 FOR I=1 TO 8:PRINT ".";:FOR J=1 TO 8:K3=0:Z(I,J)=0:R1=RND(1)
380 IF R1>.98 THEN K3=3:K9=K9+3:GOTO 410
390 IF R1>.95 THEN K3=2:K9=K9+2:GOTO 410
400 IF R1>.80 THEN K3=1:K9=K9+1
410 B3=0:IF RND(1)>.96 THEN B3=1:B9=B9+1
420 G(I,J)=K3*100+B3*10+FNR(1):NEXT J:NEXT I:IF K9>T9 THEN T9=K9+1
430 PRINT" DONE!"
440 GOSUB 6080
450 GOSUB 6150
460 PRINT:GOSUB 6020
470 IF B9<>0 THEN GOTO 500
480 IF G(Q1,Q2)<200 THEN G(Q1,Q2)=G(Q1,Q2)+120:K9=K9+1
490 B9=1:G(Q1,Q2)=G(Q1,Q2)+10:Q1=FNR(1):Q2=FNR(1)
500 K7=K9:IF B9<>1 THEN X$="S":X0$=" ARE "
510 PRINT:PRINT"YOUR ORDERS ARE AS FOLLOWS:":PRINT
520 PRINT"DESTROY THE ";K9;" KLINGON WARSHIPS BEFORE"
530 PRINT"STARDATE ";T0+T9;". THIS GIVES YOU ";T9;" DAYS."
540 PRINT "THERE'S ";B9;" STARBASE";X$;" IN THE GALAXY"
550 PRINT"FOR RESUPPLYING & REPAIRING YOUR SHIP."
560 I=RND(1):REM IF INP(1)=13 THEN 1300
570 REM HERE ANY TIME NEW QUADRANT ENTERED
580 Z4=Q1:Z5=Q2:K3=0:B3=0:S3=0:G5=0:D4=.5*RND(1):Z(Q1,Q2)=G(Q1,Q2)
590 IF Q1<1 OR Q1>8 OR Q2<1 OR Q2>8 THEN GOTO 700
600 GOSUB 5610:PRINT:IF T0<>T THEN GOTO 650
610 PRINT"YOUR MISSION BEGINS WITH YOUR STARSHIP"
620 PRINT"IN THE QUADRANT, '";G2$;"'.":quadname$=G2$
630 SRSFLAG=1
640 GOTO 670
650 IF ATAKFLAG=1 THEN GOSUB 6020:ATAKFLAG=0:PRINT
660 SRSFLAG=1:PRINT"ENTERING ";G2$;" QUADRANT...":quadname$=G2$
670 K3=INT(G(Q1,Q2)*.01):B3=INT(G(Q1,Q2)*.1)-10*K3
680 S3=G(Q1,Q2)-100*K3-10*B3
690 I=1
695 K(I,1)=0:K(I,2)=0:I=I+1:IF I>3 THEN GOTO 700 ELSE GOTO 695
700 I=1
705 K(I,3)=0:I=I+1:IF I>3 THEN GOTO 706 ELSE GOTO 705
706 Q$=Z$+Z$+Z$+Z$+Z$+Z$+Z$+LEFT$(Z$,17)
710 REM POSITION ENTERPRISE, KLINGONS, STARBASES, & STARS
730 A$=FCOL$+"E"+BCOL$:Z1=S1:Z2=S2:GOSUB 5400:IF K3<1 THEN GOTO 760
740 I%=1
745 GOSUB 5370:A$=ECOL$+"K"+BCOL$:Z1=R1:Z2=R2
750 GOSUB 5400:K(I%,1)=R1:K(I%,2)=R2:K(I%,3)=S9*(0.5+RND(1)):I%=I%+1:IF I%>K3 THEN GOTO 760 ELSE GOTO 745
760 IF B3<1 THEN GOTO 780
770 GOSUB 5370:A$=DCOL$+"B"+BCOL$:Z1=R1:B4=R1:Z2=R2:B5=R2:GOSUB 5400
780 FOR I=1 TO S3:GOSUB 5370:A$=HCOL$+"*"+BCOL$:Z1=R1:Z2=R2:GOSUB 5400:NEXT I
790 GOSUB 3580
800 IF S+E>10 THEN IF E>10 OR D(7)=0 THEN GOTO 890
810 PRINT:PRINT"** FATAL ERROR **"
820 PRINT"YOU'VE STRANDED YOUR SHIP IN SPACE."
830 PRINT"YOU HAVE INSUFFICIENT MANOEUVRING"
840 PRINT"ENERGY, & SHIELD CONTROL IS PRESENTLY"
850 PRINT"INCAPABLE OF CROSS-CIRCUITING TO"
860 PRINT"ENGINE ROOM!!"
870 PRINT:GOSUB 6020
880 GOTO 3370
890 PRINT:SRSFLAG=0:LX=3:PRINT"COMMAND: ";:GOSUB 5860
900 A$=LII$:Z2$=A$:ATAKFLAG=0
905 IF A$="SLS" THEN SLSFLAG=1
906 IF A$="SLS" THEN PRINT:PRINT "SHORT & LONG RANGE SCAN...":GOTO 3570
910 IF A$<>"KEY" THEN GOTO 940
920 GOSUB 6080:REM KEY TO SRS ICONS
930 GOTO 890
940 COMFLAG=0:IF A$="GAL" AND D(8)>=0 THEN A$="COM":COMFLAG=1
950 I=1
955 IF LEFT$(A$,3)<>MID$(A1$,3*I-2,3) THEN GOTO 970
960 ON I GOTO 1000,790,1850,2110,2380,2820,2950,4140,3420
970 I=I+1:IF I>9 THEN GOTO 975 ELSE GOTO 955
975 GOSUB 6150
980 GOTO 800
990 REM COURSE CONTROL
1000 GOSUB 6290
1010 PRINT:LX=5:PRINT"COURSE (1-9): ";:GOSUB 5860
1020 C1=VAL(LII$):IF C1=9 THEN C1=1
1030 IF C1>=1 AND C1<9 THEN GOTO 1060
1040 PRINT:PRINT"LT. SULU REPORTS, 'INCORRECT COURSE"
1050 PRINT"DATA, SIR!'":GOTO 800
1060 X$="8":IF D(1)<0 THEN X$="0.2"
1070 SRSFLAG=1:LX=5:PRINT"WARP FACTOR (0-";X$;"): ";:GOSUB 5860
1080 W1=VAL(LII$):IF D(1)<0 AND W1>.2 THEN GOTO 1130
1090 IF W1>0 AND W1<=8 THEN GOTO 1150
1100 IF W1=0 THEN GOTO 800
1110 PRINT:PRINT"CHIEF ENGINEER SCOTT REPORTS 'THE"
1120 PRINT"ENGINES WON'T TAKE WARP ";W1;"!'":GOTO 800
1130 PRINT:PRINT"WARP ENGINES ARE DAMAGED."
1140 PRINT"MAXIMUM SPEED = WARP 0.2"::GOTO 800
1150 N=INT(W1*8+.5):IF E-N>=0 THEN GOTO 1240
1160 PRINT:PRINT"ENGINEERING REPORTS 'INSUFFICIENT ENERGY";
1170 PRINT"AVAILABLE FOR WARP ";W1;"!'"
1180 IF S<N-E OR D(7)<0 THEN GOTO 800
1190 PRINT:PRINT"DEFLECTOR CONTROL ROOM ACKNOWLEDGES"
1200 S1$=STR$(S)
1210 PRINT "SHIELD ENERGY DEPLOYED IS ";S1$;" UNITS."
1220 GOTO 800
1230 REM KLINGONS MOVE/FIRE
1240 I=1
1245 IF K(I,3)=0 THEN GOTO 1270
1250 A$=" ":Z1=K(I,1):Z2=K(I,2):GOSUB 5400:GOSUB 5370
1260 K(I,1)=Z1:K(I,2)=Z2:A$=ECOL$+"K"+BCOL$:GOSUB 5400
1270 I=I+1:IF I>K3 THEN GOTO 1275 ELSE GOTO 1245
1275 GOSUB 3210:D1=0:D6=W1:IF W1>=1 THEN D6=1
1280 I=1
1285 IF D(I)>=0 THEN GOTO 1330
1290 D(I)=D(I)+D6:IF D(I)>-.1 AND D(I)<0 THEN D(I)=-.1:GOTO1330
1300 IF D(I)<0 THEN GOTO 1330
1310 IF D1<>1 THEN D1=1:PRINT:PRINT"DAMAGE CONTROL REPORT: "
1320 R1=I:GOSUB 5460:PRINTG2$;" REPAIR COMPLETED"
1330 I=I+1:IF I>8 THEN GOTO 1340 ELSE GOTO 1285
1340 IF RND(1)>.2 THEN GOTO 1410
1350 R1=FNR(1):IF RND(1)>=.6 THEN GOTO 1380
1360 D(R1)=D(R1)-(RND(1)*5+1):PRINT:PRINT"DAMAGE CONTROL REPORTS:"
1370 GOSUB 5460:PRINTG2$;" DAMAGED":GOTO 1410
1380 D(R1)=D(R1)+RND(1)*3+1:PRINT:PRINT"DAMAGE CONTROL REPORTS:"
1390 GOSUB 5460:PRINTG2$;" PARTLY REPAIRED"
1400 REM MOVING STARSHIP
1410 A$=" ":Z1=INT(S1):Z2=INT(S2):GOSUB 5400
1420 X1=C(C1,1)+(C(C1+1,1)-C(C1,1))*(C1-INT(C1)):X=S1:Y=S2
1430 X2=C(C1,2)+(C(C1+1,2)-C(C1,2))*(C1-INT(C1)):Q4=Q1:Q5=Q2
1440 I=1
1445 S1=S1+X1:S2=S2+X2:IF S1<1 OR S1>=9 OR S2<1 OR S2>=9 THEN GOTO 1580
1450 S8=INT(S1)*24+INT(S2)*3-26:IF MID$(Q$,S8,2)=" "THEN GOTO 1510
1460 S1=INT(S1-X1):S2=INT(S2-X2):PRINT:PRINT"WARP ENGINES SHUT DOWN AT ";
1470 PRINT"SECTOR ";S1;",";S2
1480 PRINT"DUE TO BAD NAVIGATION"
1490 SRSFLAG=1
1500 GOTO 1520
1510 I=I+1:IF I>N THEN GOTO 1515 ELSE GOTO 1445
1515 S1=INT(S1):S2=INT(S2)
1520 A$=FCOL$+"E"+BCOL$:Z1=INT(S1):Z2=INT(S2):GOSUB 5400:GOSUB 1790:T8=1
1530 IF W1<1 THEN T8=.1*INT(10*W1)
1540 T=T+T8:IF T>T0+T9 THEN GOTO 3370
1550 REM SEE IF DOCKED
1560 GOTO 790
1570 REM EXCEED LIMITS
1580 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)
1590 S2=INT(Y-Q2*8):IF S1=0 THEN Q1=Q1-1:S1=8
1600 IF S2=0 THEN Q2=Q2-1:S2=8
1610 X5=0:IF Q1<1 THEN X5=1:Q1=1:S1=1
1620 IF Q1>8 THEN X5=1:Q1=8:S1=8
1630 IF Q2<1 THEN X5=1:Q2=1:S2=1
1640 IF Q2>8 THEN X5=1:Q2=8:S2=8
1650 IF X5=0 THEN GOTO 1760
1660 PRINT:PRINT"LT. UHURA REPORTS MESSAGE FROM STARFLEET";
1670 PRINT"COMMAND: 'PERMISSION TO ATTEMPT CROSSING";
1680 PRINT"OF GALACTIC PERIMETER IS HEREBY"
1690 PRINT"*DENIED*. SHUT DOWN YOUR ENGINES.'"
1700 PRINT:PRINT"CHIEF ENGINEER SCOTT REPORTS 'WARP"
1710 PRINT"ENGINES SHUT DOWN AT SECTOR ";S1;",";S2
1720 PRINT"OF QUADRANT ";Q1;",";Q2;".'"
1730 SRSFLAG=1
1740 PRINT:GOSUB 6020
1750 IF T>T0+T9 THEN GOTO 3370
1760 IF 8*Q1+Q2=8*Q4+Q5 THEN GOTO 1520
1770 T=T+1:GOSUB 1790:GOTO 580
1780 REM MANEUVER ENERGY
1790 E=E-N-10:IF E>=0 THEN RETURN
1800 PRINT:PRINT"SHIELD CONTROL SUPPLIES ENERGY TO"
1810 PRINT"COMPLETE THE MANOEUVRE."
1820 S=S+E:E=0:IF S<=0 THEN S=0
1830 RETURN
1840 REM LONG RANGE SCAN
1850 K1=0
1860 IF D(3)<0 THEN PRINT:PRINT"LONG RANGE SENSORS ARE INOPERABLE"
1865 IF D(3)<0 THEN SLSFLAG=0:GOTO800
1870 PRINT:PRINT"LONG RANGE SCAN FOR QUADRANT ";Q1;",";Q2
1880 PRINT:O1$=" +-----+-----+-----+":PRINTO1$;
1890 PRINT " ###"
1900 I=Q1-1:II=Q1+1
1902 N(1)=-1:N(2)=-2:N(3)=-3
1904 J=Q2-1:JJ=Q2+1
1910 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)
1920 J=J+1:IF J>JJ THEN GOTO 1925 ELSE GOTO 1910
1925 L=1
1930 REM IF K1=2 AND L=3 THEN PRINT CHR$(146);"";
1940 PRINT BCOL$;":";
1950 IF K1=2 AND L=2 THEN PRINT FCOL$;:GOTO 1970
1960 PRINT " ";
1970 IF N(L)<0 THEN PRINT"***";:GOTO 2000
1980 G1$=RIGHT$(STR$(N(L)+1000),3)
1990 G2$=MID$(G1$,1,3):PRINT G2$;
2000 L=L+1:IF L>3 THEN GOTO 2005 ELSE GOTO 1930
2005 PRINT" :";:K1=K1+1
2010 IF K1=1 THEN PRINT " . . ."
2020 IF K1=3 THEN PRINT " . . ."
2030 IF K1=5 THEN PRINT " . ."
2040 K1=K1+1:PRINTO1$;
2050 IF K1=2 THEN PRINT " . . ."
2060 IF K1=4 THEN PRINT " . BASES";
2070 IF K1=4 THEN PRINT " ."
2080 IF K1=6 THEN PRINT " KLINGONS STARS"
2090 I=I+1:IF I>II THEN GOTO 2093 ELSE GOTO 1902
2093 K1=0:IF SLSFLAG=1 THEN SLSFLAG=0
2095 GOTO 890
2100 REM PHASER CONTROL
2110 IF D(4)<0 THEN PRINT:PRINT"PHASERS INOPERATIVE":GOTO 800
2120 IF K3>0 THEN GOTO 2150
2130 PRINT:PRINT"SCIENCE OFFICER SPOCK REPORTS 'SENSORS"
2140 PRINT"SHOW NO ENEMY SHIPS IN THIS QUADRANT'":GOTO 800
2150 IF D(8)<0 THEN PRINT:PRINT"COMPUTER FAILURE HAMPERS ACCURACY"
2160 PRINT:PRINT"PHASERS LOCKED ON TARGET! "
2170 PRINT:PRINT"ENERGY AVAILABLE = ";E;" UNITS"
2180 LX=5:PRINT "NUMBER OF UNITS TO FIRE: ";:GOSUB 5860
2190 X=VAL(LII$):IF X<=0 THEN GOTO 800
2200 IF E-X<0 THEN GOTO 2170
2210 E=E-X:IF D(7)<0 THEN X=X*RND(1)
2220 H1=INT(X/K3):I=1
2225 IF K(I,3)<=0 THEN GOTO 2340
2230 H=INT((H1/FND(0))*(RND(1)+2)):IF H>.15*K(I,3) THEN GOTO 2270
2240 PRINT:PRINT" SENSORS SHOW NO DAMAGE TO ENEMY"
2250 PRINT" AT ";K(I,1);",";K(I,2)
2260 GOTO 2340
2270 K(I,3)=K(I,3)-H:PRINT
2280 PRINT " ";H;" UNIT HIT KLINGON AT ";K(I,1);",";K(I,2)
2290 IF K(I,3)<=0 THEN PRINT" *** KLINGON DESTROYED ***":GOTO 2320
2300 PRINT" (SENSORS SHOW ";INT(K(I,3));" UNITS REMAINING)"
2310 GOTO 2340
2320 K3=K3-1:K9=K9-1:Z1=K(I,1):Z2=K(I,2):A$=" ":GOSUB 5400
2330 K(I,3)=0:G(Q1,Q2)=G(Q1,Q2)-100:Z(Q1,Q2)=G(Q1,Q2):IF K9<=0 THEN GOTO 3510
2340 I=I+1:IF I>3 THEN GOTO 2350 ELSE GOTO 2225
2350 IF K3>0 THEN PRINT:GOSUB 6020
2360 GOSUB 3210:GOTO 800
2370 REM PHOTON TORPEDO
2380 IF P<=0 THEN PRINT:PRINT"ALL PHOTON TORPEDOES EXPENDED":GOTO 800
2390 IF D(5)<0 THEN PRINT:PRINT"PHOTON TUBES ARE NOT OPERATIONAL":GOTO 800
2400 GOSUB 6290:REM ** DIRECTION HELPER **
2410 PRINT:LX=5:PRINT "PHOTON TORPEDO COURSE (1-9): ";:GOSUB 5860
2420 C1=VAL(LII$):IF C1=9 THEN C1=1
2430 IF C1>=1 AND C1<9 THEN GOTO 2470
2440 PRINT:PRINT"ENSIGN CHEKOV REPORTS, 'INCORRECT"
2450 PRINT"COURSE DATA, SIR!'"
2460 GOTO 800
2470 X1=C(C1,1)+(C(C1+1,1)-C(C1,1))*(C1-INT(C1)):E=E-2:P=P-1
2480 X2=C(C1,2)+(C(C1+1,2)-C(C1,2))*(C1-INT(C1)):X=S1:Y=S2
2490 PRINT:PRINT"TORPEDO TRACKING:"
2500 X=X+X1:Y=Y+X2:X3=INT(X+.5):Y3=INT(Y+.5)
2510 IF X3<1 OR X3>8 OR Y3<1 OR Y3>8 THEN GOTO 2780
2520 PRINT" ";X3;",";Y3:A$=" ":Z1=X:Z2=Y:GOSUB 5560
2530 IF Z3<>0 THEN GOTO 2500
2540 A$=ECOL$+"K"+BCOL$:Z1=X:Z2=Y:GOSUB 5560:IF Z3=0 THEN GOTO 2610
2550 PRINT" *** KLINGON DESTROYED ***"
2560 K3=K3-1:IF K3>0 THEN PRINT:GOSUB 6020
2570 K9=K9-1:IF K9<=0 THEN GOTO 3510
2580 I=1
2585 IF X3=K(I,1) AND Y3=K(I,2) THEN GOTO 2600
2590 I=I+1:IF I>3 THEN GOTO 2595 ELSE GOTO 2585
2595 I=3
2600 K(I,3)=0:GOTO 2760
2610 A$=HCOL$+"*"+BCOL$:Z1=X:Z2=Y:GOSUB 5560:IF Z3=0 THEN GOTO 2650
2620 PRINT" ** STAR AT ";X3;",";Y3;" ABSORBED TORPEDO **"
2630 IF K3<>0 THEN PRINT:GOSUB 6020
2640 GOSUB 3210:GOTO 800
2650 A$=DCOL$+"B"+BCOL$:Z1=X:Z2=Y:GOSUB 5560:IF Z3=0 THEN GOTO 2400
2660 PRINT" *** STARBASE DESTROYED ***"
2670 PRINT:GOSUB 6020
2680 B3=B3-1:B9=B9-1
2690 IF B9>0 OR K9>T-T0-T9 THEN GOTO 2740
2700 PRINT:PRINT"THAT DOES IT, CAPTAIN!! YOU ARE HEREBY"
2710 PRINT"RELIEVED OF COMMAND AND SENTENCED TO 99"
2720 PRINT"STARDATES AT HARD LABOUR ON CYGNUS 12!!"
2730 GOTO 3420
2740 PRINT:PRINT"STARFLEET COMMAND REVIEWING YOUR RECORD"
2750 PRINT"TO CONSIDER COURT MARTIAL!":D0=0
2760 Z1=X:Z2=Y:A$=" ":GOSUB 5400
2770 G(Q1,Q2)=K3*100+B3*10+S3:Z(Q1,Q2)=G(Q1,Q2):GOSUB 3210:GOTO 800
2780 PRINT" ** TORPEDO MISSED **"
2790 IF K3<>0 THEN PRINT:GOSUB 6020
2800 GOSUB 3210:GOTO 800
2810 REM SHIELD CONTROL
2820 IFD(7)<0THEN PRINT:PRINT"SHIELD CONTROL INOPERABLE":GOTO800
2830 PRINT:PRINT"ENERGY AVAILABLE = ";E+S
2840 LX=5:PRINT"NUMBER OF UNITS TO SHIELDS: ";:GOSUB 5860
2850 X=VAL(LII$)
2860 IF X<0 OR S=X THEN PRINT"<SHIELDS UNCHANGED>":GOTO 800
2870 IF X<=E+S THEN GOTO 2910
2880 PRINT:PRINT"SHIELD CONTROL REPORTS 'THIS IS NOT THE"
2890 PRINT"FEDERATION TREASURY.'"
2900 PRINT"<SHIELDS UNCHANGED>":GOTO 800
2910 E=E+S-X:S=X:PRINT:PRINT"DEFLECTOR CONTROL ROOM REPORT:"
2920 PRINT"'SHIELDS NOW AT ";INT(S);" UNITS PER"
2930 PRINT"YOUR COMMAND.'":GOTO 800
2940 REM DAMAGE CONTROL
2950 IF D(6)>=0 THEN GOTO 3100
2960 PRINT:PRINT"DAMAGE CONTROL REPORT NOT AVAILABLE"
2970 IF D0=0 THEN GOTO 800
2980 D3=0:FOR I=1 TO 8:IF D(I)<0 THEN D3=D3+.1
2990 NEXT I:IF D3=0 THEN GOTO 800
3000 D3=D3+D4:IF D3>=1 THEN D3=.9
3010 PRINT:PRINT"TECHNICIANS STANDING BY TO EFFECT"
3020 PRINT"REPAIRS TO YOUR SHIP;"
3030 PRINT"ESTIMATED TIME TO REPAIR:"
3040 PRINT .01*INT(100*D3);" STARDATES"
3050 LX=1:PRINT:PRINT "AUTHORISE THE REPAIR ORDER (Y/N)? ";:GOSUB 5860
3060 A$=LII$
3070 IF A$<>"Y" THEN GOTO 800
3080 FOR I=1 TO 8:IF D(I)<0THEND(I)=0
3090 NEXT I:T=T+D3+.1
3100 PRINT:PRINT" SYSTEM STATE OF REPAIR"
3110 PRINT " ------------------- -----------------"
3120 FOR R1=1 TO 8
3130 GOSUB 5460:PRINT" ";G2$;LEFT$(Z$,19-LEN(G2$));
3140 D2=INT(D(R1)*10)*.1
3150 IF D2<0 THEN PRINT CCOL$;"DAMAGED ";D2;BCOL$
3160 IF D2>0 THEN PRINT " OPERATIONAL ";D2
3170 IF D2=0 THEN PRINT " OPERATIONAL ";D2
3180 NEXT R1:IF D0<>0 THEN GOTO 2980
3190 GOTO 800
3200 REM KLINGONS SHOOTING
3210 IF K3<=0 THEN RETURN
3220 IF D0<>0 THEN PRINT:PRINT"STARBASE SHIELDS PROTECT THE ENTERPRISE"
3230 IF D0<>0 THEN RETURN
3240 I=1
3245 IF K(I,3)<=0 THEN GOTO 3330
3250 H=INT((K(I,3)/FND(1))*(2+RND(1))):S=S-H:K(I,3)=K(I,3)/(3+RND(0))
3260 PRINT:PRINT " ";H;" UNIT HIT ENTERPRISE FROM ";K(I,1);",";K(I,2)
3270 IF S<=0 THEN GOTO 3380
3280 PRINT" <SHIELDS DOWN TO ";S;" UNITS>":IF H<20 THEN GOTO 3330
3290 IF RND(1)>.6 OR H/S<=.02 THEN GOTO 3330
3300 R1=FNR(1):D(R1)=D(R1)-H/S-.5*RND(1):GOSUB 5460
3310 PRINT:PRINT"DAMAGE CONTROL REPORTS: "
3320 PRINT G2$;" DAMAGED BY THE HIT"
3330 I=I+1:IF I>3 THEN GOTO 3340 ELSE GOTO 3245
3340 ATAKFLAG=1
3350 RETURN
3360 REM END OF GAME
3370 PRINT:PRINT"IT IS STARDATE ";T:GOTO 3420
3380 PRINT:GOSUB 6020
3390 PRINT:PRINT"THE ENTERPRISE HAS BEEN DESTROYED. THE"
3400 PRINT"FEDERATION WILL BE CONQUERED"
3410 GOTO 3370
3420 PRINT:PRINT"THERE WERE ";K9;" KLINGON BATTLE CRUISERS"
3430 PRINT"LEFT AT THE END OF YOUR MISSION."
3440 IFB9=0THEN GOTO 3500
3450 PRINT:PRINT"THE FEDERATION IS IN NEED OF A NEW"
3460 PRINT"STARSHIP COMMANDER FOR ANOTHER MISSION."
3470 PRINT:PRINT"... IF THERE IS A VOLUNTEER,"
3480 LX=3:PRINT "STEP FORWARD AND ENTER 'AYE': ";:GOSUB 5860
3490 A$=LII$:IF A$="AYE" THEN GOTO 10
3500 GOTO 3500
3510 PRINT:GOSUB 6020
3520 PRINT:PRINT"CONGRATULATIONS, CAPTAIN! THE LAST"
3530 PRINT"KLINGON BATTLE CRUISER MENACING THE"
3540 PRINT"FEDERATION HAS BEEN DESTROYED."
3550 PRINT:PRINT"YOUR EFFICIENCY RATING IS ";
3560 PRINT INT(1000*(K7/(T-T0))^2):GOTO3440
3570 REM SHORT RANGE SCAN
3580 IF ATAKFLAG=1 THEN PRINT:GOSUB 6020:ATAKFLAG=0
3590 IF D(2)<0 THEN GOTO 3720
3600 REM
3610 IF SRSFLAG=0 THEN PRINT:PRINT"SHORT RANGE SCAN + SUMMARY DATA"
3620 SRSFLAG=0:ATAKFLAG=0
3630 II=S1-1:II2=S1+1
3632 JJ=S2-1:JJ2=S2+1
3640 IF INT(II+.5)<1 OR INT(II+.5)>8 OR INT(JJ+.5)<1 OR INT(JJ+.5)>8 THEN GOTO 3660
3650 A$=DCOL$+"B"+BCOL$:Z1=II:Z2=JJ:GOSUB 5560:IF Z3=1 THEN GOTO 3670
3660 JJ=JJ+1:IF JJ>JJ2 THEN GOTO 3662 ELSE GOTO 3640
3662 II=II+1:IF II>II2 THEN GOTO 3665 ELSE GOTO 3632
3665 D0=0:IF Z3=1 THEN GOTO 3670 ELSE GOTO 3690
3670 D0=1:C$=DCOL$+"DOCKED"+BCOL$:E=E0:P=P0
3680 PRINT:PRINT"SHIELDS DROPPED FOR DOCKING PURPOSES":S=0:GOTO3710
3690 IF K3>0 THEN C$=CCOL$+"*RED*"+BCOL$:GOTO 3710
3700 C$=FCOL$+"GREEN"+BCOL$:IF E<E0*.1 THEN C$=ICOL$+"AMBER"+BCOL$
3710 IF D(2)>=0 THEN GOTO 3730
3720 PRINT:PRINT"*** SHORT RANGE SENSORS ARE OUT ***"
3722 IF SLSFLAG=1 THEN GOTO 1840
3725 RETURN
3730 IF K3=0 THEN GOTO 3760
3740 PRINT:PRINT "COMBAT AREA ";
3750 PRINT CCOL$;"** CONDITION RED **";BCOL$
3760 REM
3770 LOW$=CCOL$+"LOW":PRINT
3780 REM
3790 PRINT " 1 2 3 4 5 6 7 8"
3800 REM
3810 PRINT " +-+-+-+-+-+-+-+-+ STARDATE ";INT(T*10)*.1
3820 I=1
3830 I$=STR$(I)
3840 PRINT " ";I$;":";
3850 J1=(I-1)*24+1:J2=(I-1)*24+22
3860 J=J1
3870 Z3$=MID$(Q$,J,2)
3920 PRINT Z3$;
3930 IF J=J2 THEN PRINT BCOL$;":";
3940 IF J<>J2 THEN PRINT "";
3950 J=J+3:IF J>J2 THEN GOTO 3960 ELSE GOTO 3870
3960 IF I=1 THEN PRINT" DAYS LEFT ";.1*INT((T0+T9-T)*10);
3970 IF I=2 THEN PRINT" CONDITION";
3980 IF I=2 THEN PRINT C$;
3990 IF I=3 THEN PRINT" QUADRANT ";Q1;",";Q2;
4000 IF I=4 THEN PRINT" SECTOR ";S1;",";S2;
4010 IF I=5 THEN PRINT" TORPEDOES ";INT(P);
4020 IF I=6 THEN PRINT" ENERGY ";INT(E+S);
4030 IF I=7 THEN PRINT" SHIELDS ";INT(S);
4040 IF I=7 AND S<201 AND K3>0 THEN PRINT LOW$;
4050 IF I=8 THEN PRINT" KLINGONS ";INT(K9);
4060 PRINT
4070 I=I+1:IF I>8 THEN GOTO 4075 ELSE GOTO 3830
4075 PRINT " +-+-+-+-+-+-+-+-+";
4080 MW=E/8:MW=MW*10:MW=INT(MW):MW=MW/10
4090 IF MW>8 THEN MW=8
4100 IF D(1)<0 AND MW>0.2 THEN MW=0.2
4110 PRINT" MAX WARP ";MW
4115 IF SLSFLAG=1 THEN GOTO 1840
4120 RETURN
4130 REM LIBRARY COMPUTER CODE
4140 IF D(8)<0 THEN PRINT:PRINT"COMPUTER DISABLED":GOTO800
4150 PRINT:PRINT"FUNCTIONS AVAILABLE FROM COMPUTER:":PRINT
4160 PRINT" 0 - CUMULATIVE GALACTIC RECORD"
4170 PRINT" 1 - STATUS & DAMAGE REPORT"
4180 PRINT" 2 - PHOTON TORPEDO TARGETING DATA"
4190 PRINT" 3 - STARBASE NAV DATA"
4200 PRINT" 4 - DIRECTION/DISTANCE CALCULATOR"
4210 PRINT" 5 - GALAXY 'REGION NAME' MAP"
4220 PRINT:LX=1:PRINT"COMPUTER ACTIVE & AWAITING COMMAND: ";
4230 IF COMFLAG=1 THEN PRINT "0":A=0:A1=0:GOTO 4270
4240 GOSUB 5860
4250 A=VAL(LII$):A1=A:IF A<0 OR A>5 THEN GOTO 890
4260 IF LII$="" THEN GOTO 890
4270 H8=1:ON A+1 GOTO 4310,4670,4810,5330,4880,4290
4280 REM SETUP TO CHANGE CUM GAL RECORD TO GALAXY MAP
4290 H8=0:G5=1:PRINT:PRINT"QUADRANT ";Q1;",";Q2;" (";quadname$;")"
4295 PRINT:PRINT" ";:GOTO 4340
4300 REM CUM GALACTIC RECORD
4310 PRINT:GALFLAG=0
4320 PRINT"COMPUTER RECORD OF GALAXY FOR":PRINT"QUADRANT ";Q1;",";Q2
4330 PRINT:PRINT" ";
4340 J=1
4345 J$=STR$(J):J$=RIGHT$(J$,1)
4350 IF A1=5 THEN GOSUB 6390:GOTO 4380
4360 PRINT " ";J$;" ";
4380 J=J+1:IF J>8 THEN GOTO 4390 ELSE GOTO 4345
4390 PRINT
4400 O1$=" +---+---+---+---+---+---+---+---+"
4410 PRINTO1$:I=1
4415 I$=STR$(I):I$=RIGHT$(I$,1)
4420 IF I=Q1 THEN PRINT " ";I$;
4430 IF A1=5 AND I=Q1 THEN GOTO 4540
4440 IF I<>Q1 THEN PRINT" ";I$;:IF H8=0 THEN GOTO 4540
4450 J=1
4460 IF I=Q1 AND J=Q2 THEN PRINT FCOL$;:GALFLAG=1:GOTO 4490
4470 IF I=Q1 AND J-1=Q2 THEN GOTO 4490
4480 IF I<>Q1 OR J<>Q2 THEN PRINT":";
4490 IF Z(I,J)=0 THEN PRINT" ";:GOTO 4530
4500 G1$=RIGHT$(STR$(Z(I,J)+1000),3)
4502 G2$=MID$(G1$,1,3):PRINT G2$;
4520 IF GALFLAG=1 THEN PRINT BCOL$;:GALFLAG=0
4530 J=J+1:IF J>8 THEN GOTO 4535 ELSE GOTO 4460
4535 GOTO 4620
4540 Z4=I:Z5=1:GOSUB 5610:J0=INT(11-.5*LEN(G2$))
4550 PRINT":";
4560 IF I=Q1 AND Q2<5 THEN PRINT FCOL$;TAB(J0);G2$;BCOL$;:GOTO 4580
4570 PRINTTAB(J0);G2$;
4580 PRINTTAB(18);":";
4590 Z5=5:GOSUB 5610:J0=INT(27-.5*LEN(G2$))
4600 IF I=Q1 AND Q2>4 THEN PRINT FCOL$;TAB(J0);G2$;BCOL$;:GOTO 4615
4610 PRINTTAB(J0);G2$;
4615 PRINTTAB(34);":";
4620 IF A=0 AND J=9 AND Q1=I AND Q2=8 THEN PRINT:GOTO 4640
4630 IF A=0 THEN PRINT":"
4640 IF A=5 THEN PRINT
4650 PRINTO1$:I=I+1:IF I>8 THEN GOTO 4655 ELSE GOTO 4415
4655 A1=0:GOTO 800
4660 REM STATUS
4670 PRINT:PRINT "STATUS REPORT:":X$="":IF K9>1 THEN X$="S"
4680 PRINT:PRINT" KLINGONS LEFT : ";K9
4690 PRINT" ENERGY : ";INT(E+S)
4700 PRINT" TORPEDOES : ";INT(P)
4710 PRINT:PRINT" MISSION MUST BE COMPLETED IN ";.1*INT((T0+T9-T)*10)
4720 PRINT" STARDATES"
4730 X$="S":IF B9<2 THEN X$="":IF B9<1 THEN GOTO 4770
4740 PRINT:PRINT" THE FEDERATION IS MAINTAINING ";B9
4750 PRINT " STARBASE";X$;" IN THE GALAXY"
4760 GOTO 2950
4770 PRINT:PRINT"YOUR STUPIDITY HAS LEFT YOU ON YOUR OWN"
4780 PRINT"IN THE GALAXY -- YOU HAVE NO STARBASES"
4790 PRINT"LEFT!":GOTO 2950
4800 REM TORPEDO, BASE NAV, D/D CALCULATOR
4810 IF K3<=0 THEN GOTO 2130
4820 X$="":IFK3>1THENX$="S"
4830 PRINT:PRINT"FROM ENTERPRISE TO KLINGON SHIP";
4840 PRINT X$
4850 H8=0:FOR I=1 TO 3:IF K(I,3)<=0 THEN GOTO 5320
4860 W1=K(I,1):X=K(I,2)
4870 C1=S1:A=S2:GOTO 5000
4880 PRINT:PRINT"DIRECTION/DISTANCE CALCULATOR:"
4890 PRINT:PRINT"YOU ARE AT QUADRANT ";Q1;",";Q2
4900 PRINT" SECTOR ";S1;",";S2
4910 PRINT:LX=4:PRINT"ENTER INITIAL COORDINATES (Y): ";:GOSUB 5860
4920 C1=VAL(LII$):IF C1=0 THEN PRINT:PRINT"CALCULATION ABORTED!":GOTO 890
4930 LX=4:PRINT"ENTER INITIAL COORDINATES (X): ";:GOSUB 5860
4940 A=VAL(LII$):IF A=0 THEN PRINT:PRINT"CALCULATION ABORTED!":GOTO 890
4950 PRINT:LX=4:PRINT"ENTER FINAL COORDINATES (Y): ";:GOSUB 5860
4960 W1=VAL(LII$):IF W1=0 THEN PRINT:PRINT"CALCULATION ABORTED!":GOTO 890
4970 LX=4:PRINT"ENTER FINAL COORDINATES (X): ";:GOSUB 5860
4980 X=VAL(LII$):IF X=0 THEN PRINT:PRINT"CALCULATION ABORTED!":GOTO 890
4990 IF C1=W1 AND A=X THEN PRINT:PRINT"NO RESULTS POSSIBLE!":GOTO 890
5000 X=X-A:A=C1-W1:IF X<0 THEN GOTO 5140
5010 IF A<0 THEN GOTO 5160
5020 IF X>0 THEN GOTO 5040
5030 IF A=0 THEN C1=5:GOTO 5050
5040 C1=1
5050 IF ABS(A)<=ABS(X)THEN GOTO 5100
5060 PRINT:PRINT" DIRECTION = ";
5070 D2=C1+(((ABS(A)-ABS(X))+ABS(A))/ABS(A))
5080 D2=D2*1000:D2=D2+0.5:D2=INT(D2):D2=D2/1000
5090 PRINT "";D2:GOTO 5260
5100 PRINT:PRINT" DIRECTION = ";
5110 D2=C1+(ABS(A)/ABS(X))
5120 D2=D2*1000:D2=D2+0.5:D2=INT(D2):D2=D2/1000
5130 PRINT "";D2:GOTO 5260
5140 IF A>0THENC1=3:GOTO 5170
5150 IF X<>0THENC1=5:GOTO 5050
5160 C1=7
5170 IF ABS(A)>=ABS(X)THEN 5220
5180 PRINT:PRINT" DIRECTION = ";
5190 D2=C1+(((ABS(X)-ABS(A))+ABS(X))/ABS(X))
5200 D2=D2*1000:D2=D2+0.5:D2=INT(D2):D2=D2/1000
5210 PRINT "";D2:GOTO 5260
5220 PRINT:PRINT" DIRECTION = ";
5230 D2=C1+(ABS(X)/ABS(A))
5240 D2=D2*1000:D2=D2+0.5:D2=INT(D2):D2=D2/1000
5250 PRINT "";D2
5260 PRINT" DISTANCE = ";
5270 D2=SQR(X^2+A^2)
5280 IF A1=3 OR A1=2 THEN D2=D2/10
5290 D2=D2*1000:D2=D2+0.5:D2=INT(D2):D2=D2/1000
5300 PRINT "";D2
5310 IF H8=1 THEN GOTO 800
5320 NEXT I:GOTO 800
5330 IF B3<>0 THEN PRINT:PRINT"FROM ENTERPRISE TO STARBASE":W1=B4:X=B5:GOTO 4870
5340 PRINT:PRINT"MR. SPOCK REPORTS, 'SENSORS SHOW NO"
5350 PRINT"STARBASES IN THIS QUADRANT.'":GOTO 800
5360 REM FIND EMPTY PLACE (FOR THINGS)
5370 A$=" "
5375 R1=FNR(1):R2=FNR(1):Z1=R1:Z2=R2:GOSUB 5560:IF Z3=0 THEN GOTO 5370
5380 RETURN
5390 REM ARRAY FOR QUADRANT
5400 S8=INT(Z2-.5)*3+INT(Z1-.5)*24+1
5410 IF LEN(A$)<>3 THEN PRINT"ERROR":STOP
5420 IF S8 =1 THEN Q$=A$+RIGHT$(Q$,189):RETURN
5430 IF S8 =190 THEN Q$=LEFT$(Q$,189)+A$:RETURN
5440 Q$=LEFT$(Q$,S8-1)+A$+RIGHT$(Q$,190-S8):RETURN
5450 REM PRINTS DEVICE NAME
5460 ON R1 GOTO 5470,5480,5490,5500,5510,5520,5530,5540
5470 G2$="WARP ENGINES":RETURN
5480 G2$="SHORT RANGE SENSORS":RETURN
5490 G2$="LONG RANGE SENSORS":RETURN
5500 G2$="PHASER CONTROL":RETURN
5510 G2$="PHOTON TUBES":RETURN
5520 G2$="DAMAGE CONTROL":RETURN
5530 G2$="SHIELD CONTROL":RETURN
5540 G2$="LIBRARY-COMPUTER":RETURN
5550 REM COMPARISON QUADRANT ARRAY
5560 Z1=INT(Z1+.5):Z2=INT(Z2+.5):S8=(Z2-1)*3+(Z1-1)*24+1:Z3=0
5570 IF MID$(Q$,S8,3)<>A$ THEN RETURN
5580 Z3=1:RETURN
5590 REM QUADRANT NAME IN G2$ FROM Z4,Z5 (=Q1,Q2)
5600 REM
5610 IF Z5<=4 THEN ON Z4 GOTO 5630,5640,5650,5660,5670,5680,5690,5700
5620 GOTO 5710
5630 G2$="ANTARES":GOTO 5800
5640 G2$="RIGEL":GOTO 5800
5650 G2$="PROCYON":GOTO 5800
5660 G2$="VEGA":GOTO 5800
5670 G2$="CANOPUS":GOTO 5800
5680 G2$="ALTAIR":GOTO 5800
5690 G2$="SAGITTARIUS":GOTO 5800
5700 G2$="POLLUX":GOTO 5800
5710 ON Z4 GOTO 5720,5730,5740,5750,5760,5770,5780,5790
5720 G2$="SIRIUS":GOTO 5800
5730 G2$="DENEB":GOTO 5800
5740 G2$="CAPELLA":GOTO 5800
5750 G2$="BETELGEUSE":GOTO 5800
5760 G2$="ALDEBARAN":GOTO 5800
5770 G2$="REGULUS":GOTO 5800
5780 G2$="ARCTURUS":GOTO 5800
5790 G2$="SPICA"
5800 IF G5<>1 THEN ON Z5 GOTO 5820,5830,5840,5850,5820,5830,5840,5850
5810 RETURN
5820 G2$=G2$+" I":RETURN
5830 G2$=G2$+" II":RETURN
5840 G2$=G2$+" III":RETURN
5850 G2$=G2$+" IV":RETURN
5860 REM LX = MAX INPUT LII$ = OUTPUT
5880 GOSUB 20000:RETURN
6020 REM ** PAUSE WITHOUT CR
6030 IF CRSTART=1 THEN CR$="PRESS RETURN TO BEGIN "
6040 IF CRSTART=0 THEN CR$="PRESS RETURN TO CONTINUE "
6050 LX=0:PRINT CR$;:GOSUB 5860
6060 CRSTART=0
6070 RETURN
6080 REM ** KEY TO SRS ICONS
6090 PRINT:PRINT "KEY TO SHORT RANGE SCANNER ICONS:":PRINT
6100 PRINT FCOL$;"E";BCOL$;"= THE USS ENTERPRISE"
6110 PRINT DCOL$;"B";BCOL$;"= FEDERATION STARBASE"
6120 PRINT HCOL$;"*";BCOL$;"= STAR"
6130 PRINT ECOL$;"K";BCOL$;"= KLINGON BATTLE CRUISER"
6140 RETURN
6150 REM ** COMMANDS
6160 PRINT:PRINT"USE THESE COMMANDS:":PRINT
6170 PRINT" NAV - TO SET COURSE"
6180 PRINT" SRS - FOR SHORT RANGE SCAN"
6190 PRINT" LRS - FOR LONG RANGE SCAN"
6195 PRINT" SLS - FOR SHORT & LONG RANGE SCAN"
6200 PRINT" PHA - TO FIRE PHASERS"
6210 PRINT" TOR - TO FIRE PHOTON TORPEDOES"
6220 PRINT" SHE - TO RAISE OR LOWER SHIELDS"
6230 PRINT" DAM - FOR DAMAGE CONTROL REPORTS"
6240 PRINT" COM - TO CALL ON LIBRARY-COMPUTER"
6250 PRINT" KEY - DISPLAY 'KEY' TO SRS ICONS"
6260 PRINT" HLP - THIS LIST OF COMMANDS"
6270 PRINT" XXX - TO RESIGN YOUR COMMAND"
6280 RETURN
6290 REM ** DIRECTION
6300 PRINT
6310 PRINT " ENTER A NUMERIC 4 3 2"
6320 PRINT " BETWEEN 1 AND 9 . . ."
6330 PRINT " ..."
6340 PRINT " DECIMALS MAY BE 5 ---*--- 1"
6350 PRINT " USED ..."
6360 PRINT " (IE 8.527 ETC.) . . ."
6370 PRINT " 6 7 8"
6380 RETURN
6390 REM ** ROMAN NUMERALS
6410 IF J=1 OR J=5 THEN PRINT " I ";;
6420 IF J=2 OR J=6 THEN PRINT "II ";
6430 IF J=3 OR J=7 THEN PRINT "III";
6440 IF J=4 OR J=8 THEN PRINT "IV ";
6450 PRINT " ";:RETURN
6500 REM ** INITIALISATION & COLOURS
6520 BCOL$=CHR$(135):REM 135 = WHITE
6530 CCOL$=CHR$(129):REM 129 = RED
6540 DCOL$=CHR$(134):REM 134 = CYAN
6550 ECOL$=CHR$(133):REM 133 = VIOLET
6560 FCOL$=CHR$(130):REM 130 = GREEN
6580 HCOL$=CHR$(131):REM 131 = YELLOW
6590 ICOL$=CHR$(132):REM 132 = BLUE
6660 MODE 7
6670 Z2$="":ATAKFLAG=0:SLSFLAG=0
6685 RETURN
20000 REM ** LINPUT (LX=MAX LENGTH)
20005 ii$="":x%=LX:REM *FX21
20010 i$=INKEY$(0)
20020 IF i$="" THEN GOTO 20010
20030 IF ASC(i$)=127 THEN GOTO 20055
20035 IF ASC(i$)=13 AND x%=0 THEN PRINT"...":LII$=ii$:RETURN
20040 IF ASC(i$)=13 THEN PRINT::LII$=ii$:RETURN
20045 IF ASC(i$)=32 THEN GOTO 20070
20050 IF ASC(i$)<46 OR ASC(i$)>90 THEN GOTO 20010
20055 IF ASC(i$)=127 AND LEN(ii$)<1 THEN GOTO 20010
20060 IF i$=CHR$(127) THEN i$="":ii$=LEFT$(ii$,(LEN(ii$)-1)):PRINT CHR$(127);
20070 IF LEN(ii$)<x% THEN PRINT i$;
20080 IF LEN(ii$)<x% THEN ii$=ii$+i$
20090 GOTO 20010