The Best of Creative Computing Volume 1 (published 1976)

Page 279 << PREVIOUS >> NEXT Jump to page:
Go to contents Go to thumbnails

Super Star Trek

graphic of page

3940 LET S-S+E
3950 LET E=0
3960 If S>0 THEN GOTO 3980
3970 LET S=0
3980 RETURN
3990 REM L. R. SENSOR SCAN CODE ***
4000 If D[ 3 ]>=0 THEN GOTO 4030
4010 PRINT "LONG RANGE SENSORS ARE INOPRABLE"

4020 GOTO 1990
4030 PRINT "LONG RANGE SENSOR SCAN FOR QUADRANT"Q1", "Q2"

4040 LET 01$="..................."

4050 PRINT 01$
4060 FOR I=Q1-1 TO Q1+1
4070    DIM N[ 3 ]
4080    FOR I1=1 TO 3  
4090      LET N[ I1 ]=0
4100    NEXT I1
4110    For J=Q2-1 TO Q2+1
4120     IF I<1 THEN GOTO 4180
4130     IF 1>0 THEN GOTO 4180
4140     IF J<1 THEN GOTO 4180
4150     IF J>0 THEN GOTO 4180
4160    NEXT J
4170    DIM P1$[20]
4180    LET P1$=": ### : ### : ### :"

4190    PRINT USING P1$, N[1], N[2], N[3]
4200    PRINT 01$
4230 NEXT I
4240 GOTO 1990
4250 REM +++ PHASER CONTROL CODE BEGINS HERE
4260 IF L3>0 THEN GOTO 4300
4270 PRINT "SCIENCE OFFICER SPOCK REPORTS 'SENSORS SHOW"

4280 PRINT "   NO ENEMY SHIPS IN THIS QUADRANT. '"

4290 GOTO 1990
4300 IF D[4]>=0 THEN GOTO 4330
4310 PRINT "PHASERS INOPERATIVE"

4320 GOTO 1990
4330 IF D[8->=0 THEN GOTO 4350 
4340 PRINT "COMPUTER FAILURE HAMPERS ACCURACY"

4350 PRINT "PHASERS LOCKER ON TARGET, "

4360 PRINT "ENERGY AVAILABLE = "E
4370 PRINT "NUMBER OF UNITS TO FIRE:",
4380 INPUT X
4390 IF X<=0 THEN GOTO 1990
4400 IF E-X<0 THEN GOTO 4360
4410 LET E=E-X
4420 GOSUB 6000
4430 IF D[7]>=0 THEN GOTO 4450
4440 LET X=X+RND<1>
4450 LET H1=INT(X/K3)
4460 FOR 1=1 TO 3
4470   IF K[I, 3]<=0 THEN GOTO 4670
4480   LET H=INT ((H1/FND(0))+(RND(1)+2))
4490   IF H>. 15+K[1, 3] THEN GOTO 4530
4500   PRINT "SENSORS SHOW NO DAMAGE"

4510   PRINT "     TO ENEMY AT "K[I, 1]", "K[I, 2]
4520   GOTO 4670
4530   LET K[I,3]=K[I,3]-H
4540   PRINT H" UNIT HIT ON KLINGON AT SECTOR "K[I,1]", "K[I, 2"]
4550   IF K[I, 3]<=0 THEN GOTO 4580
4560   PRINT "     (SENSORS SHOW"K[I, 3]" UNITS REMAINING) "

4570   GOTO 4670
4580   PRINT " +++ KLINGON DESTROYED +++"

4590   LET K3=K3-1
4600   LET K9=K9-1
4610   LET A$="    "

4620   LET Z1=K[I, 1]
4630   LET Z2=K[I, 2]
4640   GOSUB 8670
4650   LET G[Q1, Q2]=K3+100+B3+10+S3
4660   IF K9<=0 THEN GOTO 6370
4670 NEXT I
4680 GOTO 1990
4690 REM PHOTON TORPEDO CODE BEGINS +++
4700 IF D[5]>=0 THEN GOTO 4730
4710 PRINT "PHOTON TUBES ARE NOT OPERATIONAL "

4720 GOTO 1990
4730 IF P>0 THEN GOTO 4760
4740 PRINT "ALL PHOTON TORPEDOES EXPENDED"

4750 GOTO 1990
4760 PRINT "TORPEDO COURSE (1-9)",
4770 INPUT C1
4780 IF C1>=1 THEN GOTO 4810
4790 PRINT "ENSIGN CHEKOV REPORTS, 'INCORRECT COURSE DATA, SIR!'"

4800 GOTO 1990
4810 IF C1>9 THEN GOTO 4790
4820 IF C1<=9 THEN GOTO 4850
4830 IF C1>=9 THEN GOTO 4760
4840 LET C1=1
4850 LET X1=C[C1, 1]+)C[C1+1, 1])- C[C1, 1])+(C1-INT(C1))
4860 LET X2=C[C1, 1]+)C[C1+1, 1])- C[C1, 1])+(C1-INT(C1))
4870 LET E=E-2
4880 LET X=S1
4890 LET Y=S2
4900 LET P-P-1
4910 PRINT "TORPEDO TRACK:"

4920 LET X=X+X1
4930 LET Y=Y+X2
4940 LET X3=INT(X+.5)
4950 LET Y3=INT(Y+.5)
4960 IF X3<1 THEN GOTO 5490
4970 IF X3>=9 THEN GOTO 5490
4980 IF Y3<1 THEN GOTO 5490
4990 IF Y3>=9 THEN GOTO 5490
5000 PRINT "                "X3","Y3
5010 LET A$="    "

5020 LET Z1=X
5030 LET Z2=Y
5040 GOSUB 8030
5050 IF Z3 <>0 THEN GOTO 4920
5060 LET A$="+++"

5070 LET Z1=X
5080 LET Z2=Y
5090 GOSUB 8830
5100 IF Z3=0 THEN GOTO 5210
5110 PRINT "+++ KLINGON DESTROYED +++"

5120 LET K3=K3-1
5130 LET K9-K9-1
5140 IF K9<=0 THEN GOTO 6370
5150 FOR I=1 TO 3
5160   IF X3<>L[I, 1] THEN GOTO 5180
5170   IF Y3=K[I,2] THEN GOTO 5190
5180 NEXT I
5190 LET K[I,3]=0
5200 GOTO 5430
5210 LET A$= " + "

5220 LET Z1=X
5230 LET Z2 = Y
5240 GOSUB 8830
5250 IF Z3=9 THEN GOTO 5280
5260 PRINT "STAR AT"X3,","V3," ABSORBED TORPEDO ENERGY."

5270 GOTO 5500
5280 LET A$=">!<"

5290 LET Z1=X
5300 LET Z2=Y
5310 GOSUB 8830
5320 IF Z3=0 THEN GOTO 4760
5330 PRINT "+++ STARBASE DESTROYED +++"

5340 LET B3=B3-1
5350 LET B9-B9-1
5360 IF B9>0 THEN GOTO 5400
5370 PRINT "THAT DOES IT CAPTAIN!! YOU ARE HEREBY RELIEVE OF COMMAND"

5380 PRINT "   AND SENTENCED TO 99 STARDATES AT HARD LABOR ON CYGNUS 12!!"

5390 GOTO 6270
5400 PRINT "STARFLEET COMMAND REVIEWING YOUR RECORD TO CONSIDER"

5410 PRINT "   COURT MARTIAL!"

5420 LET D0=0
5430 LET A$="   "

5440 LET Z1=X
5450 LET Z2=Y 
5460 GOSUB 8670
5470 LET G[Q1, Q2]=K3+100+B3+10+S3
5480 GOTO 5500
5490 PRINT "TORPEDO MISSED"

5500 GOSUB 6000
5510 GOTO 1990
5520 REM +++ SHIELD CONTROL STARTS HERE
5530 IF D[7]>=0 THEN GOTO 5560
5540 PRINT "SHIELD CONTROL INOPERABLE"

5550 GOTO 1990
5560 PRINT "ENERGY AVAILABLE = "E+S". NUMBER OF UNITS TO SHIELDS:",
5570 INPUT X
5580 IF X>0 THEN GOTO 5620
5590 IF S<>X THEN GOTO 5620
5600 PRINT "(SHIELDS UNCHANGED)"

5610 GOTO 1990
5620 IF E+S-X<0 THEN GOTO 5560
5630 LET E=E+S-X
5640 LET S=X
5650 PRINT "DEFLECTOR CONTROL ROOM REPORT:"

5660 PRINT "   'SHIELDS NOW AT "S" PER YOUR COMMAND'"

5670 GOTO 1990
5680 REM +++ DAMAGE CONTROL STARTS HERE
5690 IF D[6]>=0 THEN GOTO 5910
5700 PRINT "DAMAGE CONTROL REPORT NOT AVAILABLE"

5710 IF D0=0 THEN GOTO 1990
5720 LET D3=0
5730 FOR I=1 TO 9
5740  IF D[I]>=0 THEN GOTO 5760
5750  LET D3=D3+.1
5760 NEXT I
5770 IF D3=0 THEN GOTO 1990
5780 LET D3=D3+D4
5790 IF D3<1 THEN GOTO 5810
5800 LET D3=.9
5810 PRINT "TECHNICIANS STANDING BY TO EFFECT REPAIRS TO YOUR SHIP,"

5820 PRINT "ESTIMATED TIME TO REPAIR: ",
5830 PRINT " USING ".# STARDATES", D3
5840 PRINT "WILL YOU AUTHORIZE THE REPAIR ORDER (YES/NO)",
5850 INPUT A$
5860 IF A$<>"YES" THEN GOTO 1990
5870 FOR I=1 TO 8
5880   LET D[I]=0
5890 NEXT I
5900 LET T=T+D3+.1
5910 PRINT
5920 PRINT "DEVICE         STATE OF REPAIR"

5930 FOR R1=1 TO 8
5940    GOSUB 8790
5950    PRINT USING "   =##. ##",D[R1]
5960 NEXT R1
5970 PRINT
5980 GOTO 5710
5990 REM "KLINGONS SHOOTING" CODE BEGINS +++
6000 IF K3<=0 THEN GOTO 6210
6010 IF D0=0 THEN GOTO 6040
6020 PRINT "STAR BASE SHIELDS PROTECT THE ENTERPRISE"

6030 GOTO 6210
6040 FOR I=1 TO 3
6050    IF K[I, 3]<- THEN GOTO 6200
6060    LET H=INT((K[1, 3]/FND(0))+(2+RND(1)))
6070    LET S=S-H
6080    PRINT H" UNIT HIT ON ENTERPRISE FROM SECTOR"K[I,1]", "K[1,2]
6090    IF S<0 THEN GOTO 6240
6100    PRINT "    (SHIELDS DOWN TO "S" UNITS. )"

6110    IF H<20 THEN GOTO 6200
6120    IF RND(1)>.6 THEN GOTO 6200
6130    IF H/S<=.02 THEN GOTO 6200
6140    LET D2=H/S+.5+RND(1)
6150    LET R1=INT (RNG(1)+8+1)
6160    LET D[R1]=D[R1]-D2
6170    PRINT "DAMAGE CONTROL REPORTS '",
6180    GOSUB 8790
6190    PRINT "DAMAGED BY THE HIT!'"

6200 NEXT I
6210 RETURN
6220 PRINT "IT IS STARDATE "T
6230 GOTO 6270
6240 PRINT
6250 PRINT "THE ENTERPRISE HAS BEEN DESTROYED. THE FEDERATION WILL BE
CONQUERED."

6260 PRINT "IT IS STARDATE "T"."

6270 PRINT "THERE WERE "K9" KLINGON BATTLE CRUISERS LEFT AT"

6280 PRINT "THE END OF YOUR MISSION."

6290 PRINT
6300 PRINT
6310 PRINT "THE FEDERATION IS IN NEED OF A NEW STARSHIP COMMANDER"

6320 PRINT "FOR A SIMILAR MISSION -- IF THERE IS A VOLUNTEER,"

6330 PRINT "LET HIM STEP FORWARD AND ENTER 'AYE'."

6340 INPUT A$
6350 IF A$="AYE" THEN GOTO 0240
6360 GOTO 9250
6370 PRINT "CONGRATULATIONS, CAPTAIN! THE LAST KLINGON BATTLE CRUISER"

6380 PRINT "   MENACING THE FEDERATION HAS BEEN DESTROYED."

6390 PRINT
6400 PRINT "YOUR EFFICIENCY RATING IS "((K7/(T-T0))+1000"."

6410 GOTO 6290
6420 REM S.R. SENSOR SCAN & STARTUP SUBR. +++
6430 FOR I=S1-1 TO S1+1
6440  FOR J=S2-1 TO S2+1
6450    IF INT(I+.5)<1 THEN GOTO 6540
6460    IF INT(I+.5)>8 THEN GOTO 6540
6470    IF INT(J+.5)<1 THEN GOTO 6540
6480    IF INT(J+.5)>8 THEN GOTO 6540
6490    LET A$=">!<"

6500    LET Z1=I
6510    LET Z2=J
6520    GOSUB 8830
6530    IF Z3=1 THEN GOTO 6580
6540   NEXT J
6550 NEXT I
6560 LET D0=0
6570 GOTO 6650

Page 279 << PREVIOUS >> NEXT Jump to page:
Go to contents Go to thumbnails