Original Star Trek Game – Mike Mayfield 1972 Version

I played a LOT of the 1970’s Star Trek computer game when at university and I’d like to recreate that version (and then maybe modify it) in Scratch and/or Snap!

So I’ve found this version which is coded to run on an HP2000F circa 1972 computer and modified it to run under  R.T.Russell BBC BASIC (for Windows or multi-platform SDL 2.0 version)

I’m not sure its the version I played on in 1977/78 but I’m using it as my current starter

The mods I’ve done are the most minimal I could get away with and 99% are trans-coding of the HP BASIC PRINT USING/IMAGE statements

No program logic should have been changed

[STATUS]

The program runs without errors for me so publishing it for others to test

NOTES

YES/NO questions require full caps YES or NO answers

Game is set to use same random seed so its easier to repeat sequences for testing – REM Line 11 for true play

Game is set to show you full galaxy using command 7 library option 0 without having to have used LR scans – REM line 741 for true play

Game uses Y,X co-ord system! So 1,1 is top left, 8,1, is bottom left.

Game is BRUTAL – stuff gets damaged for no good reason and only gets a CHANCE of being fixed by moving.  AFAICT – this is on purpose and not a result of my trans-coding!

Damage control display looks awful but AFAICT – that’s how its supposed to look!

I chose BBC BASIC mode 0 for display (80×32) but you might think it should be something else?- feel free to suggest

Installing

Download and unzip/install/run R.T.Russell BBC BASIC for SDL 2.0 (or BBC BASIC for Windows if you prefer)

Copy and paste this code into the editor

    1 REM ****  HP BASIC PROGRAM LIBRARY  ******************************
    2 REM
    3 REM       STTR1: STAR TREK
    4 REM
    5 REM       36243  REV B  --  10/73
    6 REM
    7 REM ****  CONTRIBUTED PROGRAM  ***********************************
   10 MODE 8
   11 T0=RND(-3):REM This line to remove fixed starting random seed
   12 REM w=1:REM experiemental print delay
   13 COLOUR 2: REM this line if you don't want green text
  100 REM *****************************************************************
  110 REM ***                                                           ***
  120 REM ***     STAR TREK: BY MIKE MAYFIELD, CENTERLINE ENGINEERING   ***
  130 REM ***                             ?                              ***
  140 REM ***        TOTAL INTERACTION GAME - ORIG. 20 OCT 1972
  150 REM ***                                                           ***
  160 REM *****************************************************************
  162 REM ***                                                           ***
  163 REM ***  Modified to work under R.T.Russell BBC BASIC for Windows ***
  164 REM ***  but with all orig features / formatting where possible   ***
  165 REM ***                                                           ***
  166 REM ***         by Simon Walters (@cymplecy) 4Feb2021a            ***
  167 REM *****************************************************************
  170 GOSUB 5460
  180 PRINT "                          STAR TREK "
  190 PRINT "DO YOU WANT INSTRUCTIONS (THEY'RE LONG!)";
  191 REM GOTO 230:REM un-REM this line so as not to get bothered about instruction request
  200 INPUT A$
  210 IF A$ <> "YES" THEN 230
  220 GOSUB 5820
  230 REM *****  PROGRAM STARTS HERE *****
  240 Z$="                                                                        "
  250 GOSUB 5460
  260 DIM G(8,8),C(9,2),K(3,3),N(3),Z(8,8)
  270 DIM C$(6),D$(72),E$(24),A$(3),Q$(72),R$(72),S$(48)
  280 DIM Z$(72)
  290 T0=INT(RND(1)*20+20)*100
  291 T=T0
  300 T9=30
  310 D0=0
  320 E0=3000
  321 E=E0
  322 REM E=2000:REM REM This line to remove testing energy level
  330 P0=10
  331 P=P0
  340 S9=200
  350 S=0
  351 H8=S
  352 REM S=1000:H8=S:REM REM this line to remove testing shield power
  360 DEF FND(D)=SQR((K(I,1)-S1)^2+(K(I,2)-S2)^2)
  370 Q1=INT(RND(1)*8+1)
  380 Q2=INT(RND(1)*8+1)
  390 S1=INT(RND(1)*8+1)
  400 S2=INT(RND(1)*8+1)
  410 T7=(VAL(MID$(TIME$,17,2))*60)+VAL(MID$(TIME$,20,2))
  411 REM PRINT "T7: ";T7
  412 REM PRINT "TIME$: ";MID$(TIME$,17,5)
  420 C(2,1)=-1
  421 C(3,1)=-1
  422 C(4,1)=-1
  423 C(4,2)=-1
  424 C(5,2)=-1
  425 C(6,2)=-1
  430 C(1,1)=0
  431 C(3,2)=0
  432 C(5,1)=0
  433 C(7,2)=0
  434 C(9,1)=0
  440 C(1,2)=1
  441 C(2,2)=1
  442 C(6,1)=1
  443 C(7,1)=1
  444 C(8,1)=1
  445 C(8,2)=1
  446 C(9,2)=1
  450 DIM D(10)
  451 D()=0
  460 D$="WARP ENGINESS.R. SENSORSL.R. SENSORSPHASER CNTRL"
  470 D$=D$+"PHOTON TUBESDAMAGE CNTRL"
  480 E$="SHIELD CNTRLCOMPUTER    "
  490 B9=0
  491 K9=0
  500 FOR I=1 TO 8
  510   FOR J=1 TO 8
  520     R1=RND(1)
  530     IF R1>.98 THEN 580
  540     IF R1>.95 THEN 610
  550     IF R1>.8 THEN 640
  560     K3=0
  570     GOTO 660
  580     K3=3
  590     K9=K9+3
  600     GOTO 660
  610     K3=2
  620     K9=K9+2
  630     GOTO 660
  640     K3=1
  650     K9=K9+1
  660     R1=RND(1)
  670     IF R1>.96 THEN 700
  680     B3=0
  690     GOTO 720
  700     B3=1
  710     B9=B9+1
  720     S3=INT(RND(1)*8+1)
  730     G(I,J)=K3*100+B3*10+S3
  740     Z(I,J)=0
  741     Z(I,J)=G(I,J):REM This line to remove ability to see whole galaxy without building map from LR Scans
  750   NEXT J
  760 NEXT I
  770 K7=K9
  775 IF B9 <= 0 OR K9 <= 0 THEN 490
  780 PRINT "YOU MUST DESTROY ";K9;" KLINGONS IN ";T9;" STARDATES WITH ";B9;" STARBASES"
  810 K3=0
  811 B3=0
  812 S3=0
  820 IF Q1<1 OR Q1>8 OR Q2<1 OR Q2>8 THEN 920
  830 X=G(Q1,Q2)*.01
  840 K3=INT(X)
  850 B3=INT((X-K3)*10)
  860 S3=G(Q1,Q2)-INT(G(Q1,Q2)*.1)*10
  870 IF K3=0 THEN 910
  880 IF S>200 THEN 910
  890 PRINT "COMBAT AREA      CONDITION RED"
  900 PRINT "   SHIELDS DANGEROUSLY LOW"
  910 K()=0
  920 FOR I=1 TO 3
  930   K(I,3)=0
  940 NEXT I
  950 Q$=Z$
  960 R$=Z$
  970 S$=MID$(Z$,1,48)
  980 A$="<*>"
  990 Z1=S1
 1000 Z2=S2
 1010 GOSUB 5510
 1020 IF K3=0 GOTO 1120
 1021 FOR I=1 TO K3
 1030   GOSUB 5380
 1040   A$="+++"
 1050   Z1=R1
 1060   Z2=R2
 1070   GOSUB 5510
 1080   K(I,1)=R1
 1090   K(I,2)=R2
 1100   K(I,3)=S9
 1110 NEXT I
 1120 IF B3=0 GOTO 1190
 1121 FOR I=1 TO B3
 1130   GOSUB 5380
 1140   A$=">!<"
 1150   Z1=R1
 1160   Z2=R2
 1170   GOSUB 5510
 1180 NEXT I
 1190 FOR I=1 TO S3
 1200   GOSUB 5380
 1210   A$=" * "
 1220   Z1=R1
 1230   Z2=R2
 1240   GOSUB 5510
 1250 NEXT I
 1260 GOSUB 4120
 1270 PRINT "COMMAND:";
 1280 INPUT A
 1290 REM GOTO A+1 OF 1410,1260,2330,2530,2800,3460,3560,4630
 1292 IF A=0 GOTO 1410
 1293 IF A=1 GOTO 1260
 1294 IF A=2 GOTO 2330
 1295 IF A=3 GOTO 2530
 1296 IF A=4 GOTO 2800
 1297 IF A=5 GOTO 3460
 1298 IF A=6 GOTO 3560
 1299 IF A=7 GOTO 4630
 1300 PRINT
 1310 PRINT "   0 = SET COURSE"
 1320 PRINT "   1 = SHORT RANGE SENSOR SCAN"
 1330 PRINT "   2 = LONG RANGE SENSOR SCAN"
 1340 PRINT "   3 = FIRE PHASERS"
 1350 PRINT "   4 = FIRE PHOTON TORPEDOES"
 1360 PRINT "   5 = SHIELD CONTROL"
 1370 PRINT "   6 = DAMAGE CONTROL REPORT"
 1380 PRINT "   7 = CALL ON LIBRARY COMPUTER"
 1390 PRINT
 1400 GOTO 1270
 1410 PRINT "COURSE (1-9):";
 1420 INPUT C1
 1430 IF C1=0 THEN 1270
 1440 IF C1<1 OR C1 >= 9 THEN 1410
 1450 PRINT "WARP FACTOR (0-8):";
 1460 INPUT W1
 1470 IF W1<0 OR W1>8 THEN 1410
 1480 IF D(1) >= 0 OR W1 <= .2 THEN 1510
 1490 PRINT "WARP ENGINES ARE DAMAGED, MAXIMUM SPEED = WARP .2"
 1500 GOTO 1410
 1510 IF K3 <= 0 THEN 1560
 1520 GOSUB 3790
 1530 IF K3 <= 0 THEN 1560
 1540 IF S<0 THEN 4000
 1550 GOTO 1610
 1560 IF E>0 THEN 1610
 1570 IF S<1 THEN 3920
 1580 PRINT "YOU HAVE ";INT(E);" UNITS OF ENERGY"
 1590 PRINT "SUGGEST YOU GET SOME FROM YOUR SHIELDS WHICH HAVE ";INT(S);" UNITS LEFT"
 1600 GOTO 1270
 1610 FOR I=1 TO 8
 1620   IF D(I) >= 0 THEN 1640
 1630   D(I)=D(I)+1
 1640 NEXT I
 1650 IF RND(1)>.2 THEN 1810
 1660 R1=INT(RND(1)*8+1)
 1670 IF RND(1) >= .5 THEN 1750
 1680 D(R1)=D(R1)-(RND(1)*5+1)
 1690 PRINT
 1700 PRINT "DAMAGE CONTROL REPORT: ";
 1710 GOSUB 5610
 1720 PRINT " DAMAGED"
 1730 PRINT
 1740 GOTO 1810
 1750 D(R1)=D(R1)+(RND(1)*5+1)
 1760 PRINT
 1770 PRINT "DAMAGE CONTROL REPORT: ";
 1780 GOSUB 5610
 1790 PRINT " STATE OF REPAIR IMPROVED"
 1800 PRINT
 1810 N=INT(W1*8)
 1820 A$="   "
 1830 Z1=S1
 1840 Z2=S2
 1850 GOSUB 5510
 1870 X=S1
 1880 Y=S2
 1885 C2=INT(C1)
 1890 X1=C(C2,1)+(C(C2+1,1)-C(C2,1))*(C1-C2)
 1900 X2=C(C2,2)+(C(C2+1,2)-C(C2,2))*(C1-C2)
 1910 FOR I=1 TO N
 1920   S1=S1+X1
 1930   S2=S2+X2
 1940   IF S1<.5 OR S1 >= 8.5 OR S2<.5 OR S2 >= 8.5 THEN 2170
 1950   A$="   "
 1960   Z1=S1
 1970   Z2=S2
 1980   GOSUB 5680
 1990   IF Z3 <> 0 THEN 2070
 2030   PRINT  " WARP ENGINES SHUTDOWN AT SECTOR ";S1;",";S2;" DUE TO BAD NAVIGATION"
 2040   S1=S1-X1
 2050   S2=S2-X2
 2060   GOTO 2080
 2070 NEXT I
 2080 A$="<*>"
 2083 S1=INT(S1+.5)
 2086 S2=INT(S2+.5)
 2090 Z1=S1
 2100 Z2=S2
 2110 GOSUB 5510
 2120 E=E-(N+5)
 2130 IF W1<1 THEN 2150
 2140 T=T+1
 2150 IF T>(T0+T9) THEN 3970
 2160 GOTO 1260
 2170 X=Q1*8+X+X1*N
 2180 Y=Q2*8+Y+X2*N
 2190 Q1=INT(X/8)
 2200 Q2=INT(Y/8)
 2210 S1=INT(X-Q1*8+.5)
 2220 S2=INT(Y-Q2*8+.5)
 2230 IF S1 <> 0 THEN 2260
 2240 Q1=Q1-1
 2250 S1=8
 2260 IF S2 <> 0 THEN 2290
 2270 Q2=Q2-1
 2280 S2=8
 2290 T=T+1
 2300 E=E-(N+5)
 2310 IF T>(T0+T9) THEN 3970
 2320 GOTO 810
 2330 IF D(3) >= 0 THEN 2370
 2340 PRINT "LONG RANGE SENSORS ARE INOPERABLE"
 2350 REM IMAGE  "LONG RANGE SENSOR SCAN FOR QUADRANT",D,",",D
 2360 GOTO 1270
 2370 PRINT  "LONG RANGE SENSOR SCAN FOR QUADRANT ";Q1;",";Q2
 2380 PRINT   "-----------------"
 2390 FOR I=Q1-1 TO Q1+1
 2400   N()=0
 2410   FOR J=Q2-1 TO Q2+1
 2420     IF I<1 OR I>8 OR J<1 OR J>8 THEN 2460
 2430     N(J-Q2+2)=G(I,J)
 2440     IF D(7)<0 THEN 2460
 2450     Z(I,J)=G(I,J)
 2460   NEXT J
 2470   PRINT  ": ";RIGHT$("  "+STR$(N(1)),3);" :";RIGHT$("  "+STR$(N(2)),3);" :";RIGHT$("  "+STR$(N(3)),3);" :"
 2480   PRINT   "-----------------"
 2490 NEXT I
 2500 GOTO 1270
 2510 IMAGE  ": ",3(3D," :")
 2520 IMAGE  "-----------------"
 2530 IF K3 <= 0 THEN 3670
 2540 IF D(4) >= 0 THEN 2570
 2550 PRINT "PHASER CONTROL IS DISABLED"
 2560 GOTO 1270
 2570 IF D(7) >= 0 THEN 2590
 2580 PRINT " COMPUTER FAILURE HAMPERS ACCURACY"
 2590 PRINT "PHASERS LOCKED ON TARGET.  ENERGY AVAILABLE= ";INT(E)
 2600 PRINT "NUMBER OF UNITS TO FIRE:";
 2610 INPUT X
 2620 IF X <= 0 THEN 1270
 2630 IF (E-X)<0 THEN 2570
 2640 E=E-X
 2650 GOSUB 3790
 2660 IF D(7) >= 0 THEN 2680
 2670 X=X*RND(1)
 2680 FOR I=1 TO 3
 2690   IF K(I,3) <= 0 THEN 2770
 2700   H=(X/K3/FND(0))*(2*RND(1))
 2710   K(I,3)=K(I,3)-H
 2720   PRINT INT(H);" UNIT HIT ON KLINGON AT SECTOR ";K(I,1);",";K(I,2);"   (";INT(K(I,3));" LEFT)"
 2730   REM IMAGE  4D," UNIT HIT ON KLINGON AT SECTOR ",D,",",D,"   (",3D," LEFT)"
 2740   IF K(I,3)>0 THEN 2770
 2750   GOSUB 3690
 2760   IF K9 <= 0 THEN 4040
 2770 NEXT I
 2780 IF E<0 THEN 4000
 2790 GOTO 1270
 2800 IF D(5) >= 0 THEN 2830
 2810 PRINT "PHOTON TUBES ARE NOT OPERATIONAL"
 2820 GOTO 1270
 2830 IF P>0 THEN 2860
 2840 PRINT "ALL PHOTON TORPEDOES EXPENDED"
 2850 GOTO 1270
 2860 PRINT "TORPEDO COURSE (1-9):";
 2870 INPUT C1
 2880 IF C1=0 THEN 1270
 2890 IF C1<1 OR C1 >= 9 THEN 2860
 2895 C2=INT(C1)
 2900 X1=C(C2,1)+(C(C2+1,1)-C(C2,1))*(C1-C2)
 2910 X2=C(C2,2)+(C(C2+1,2)-C(C2,2))*(C1-C2)
 2920 X=S1
 2930 Y=S2
 2940 P=P-1
 2950 PRINT "TORPEDO TRACK:"
 2960 X=X+X1
 2970 Y=Y+X2
 2980 IF X<.5 OR X >= 8.5 OR Y<.5 OR Y >= 8.5 THEN 3420
 2990 PRINT  "               ";X;",";Y
 3000 REM IMAGE  15X,D,",",D
 3010 A$="   "
 3020 Z1=X
 3030 Z2=Y
 3040 GOSUB 5680
 3050 IF Z3=0 THEN 3070
 3060 GOTO 2960
 3070 A$="+++"
 3080 Z1=X
 3090 Z2=Y
 3100 GOSUB 5680
 3110 IF Z3=0 THEN 3220
 3120 PRINT "*** KLINGON DESTROYED ***"
 3130 K3=K3-1
 3140 K9=K9-1
 3150 IF K9 <= 0 THEN 4040
 3160 FOR I=1 TO 3
 3170   IF INT(X+.5) <> K(I,1) THEN 3190
 3180   IF INT(Y+.5)=K(I,2) THEN 3200
 3190 NEXT I
 3200 K(I,3)=0
 3210 GOTO 3360
 3220 A$=" * "
 3230 Z1=X
 3240 Z2=Y
 3250 GOSUB 5680
 3260 IF Z3=0 THEN 3290
 3270 PRINT "YOU CAN'T DESTROY STARS SILLY"
 3280 GOTO 3420
 3290 A$=">!<"
 3300 Z1=X
 3310 Z2=Y
 3320 GOSUB 5680
 3330 IF Z3=0 THEN 2960
 3340 PRINT "*** STAR BASE DESTROYED ***  .......CONGRATULATIONS"
 3350 B3=B3-1
 3360 A$="   "
 3370 Z1=INT(X+.5)
 3380 Z2=INT(Y+.5)
 3390 GOSUB 5510
 3400 G(Q1,Q2)=(K3*100)+(B3*10)+S3
 3410 GOTO 3430
 3420 PRINT "TORPEDO MISSED"
 3430 GOSUB 3790
 3440 IF E<0 THEN 4000
 3450 GOTO 1270
 3460 IF D(7) >= 0 THEN 3490
 3470 PRINT "SHIELD CONTROL IS NON-OPERATIONAL"
 3480 GOTO 1270
 3490 PRINT "ENERGY AVAILABLE = ";INT(E+S);"   NUMBER OF UNITS TO SHIELDS:";
 3500 INPUT X
 3510 IF X <= 0 THEN 1270
 3520 IF E+S-X<0 THEN 3490
 3530 E=E+S-X
 3540 S=X
 3550 GOTO 1270
 3560 IF D(6) >= 0 THEN 3590
 3570 PRINT "DAMAGE CONTROL REPORT IS NOT AVAILABLE"
 3580 GOTO 1270
 3590 PRINT
 3600 PRINT "DEVICE        STATE OF REPAIR"
 3610 FOR R1=1 TO 8
 3620   GOSUB 5610
 3630   PRINT "",D(R1)
 3640 NEXT R1
 3650 PRINT
 3660 GOTO 1270
 3670 PRINT "SHORT RANGE SENSORS REPORT NO KLINGONS IN THIS QUADRANT"
 3680 GOTO 1270
 3690 PRINT "KLINGON AT SECTOR ";K(I,1);",";K(I,2);" DESTROYED ****"
 3700 REM IMAGE  "KLINGON AT SECTOR ",D,",",D," DESTROYED ****"
 3710 K3=K3-1
 3720 K9=K9-1
 3730 A$="   "
 3740 Z1=K(I,1)
 3750 Z2=K(I,2)
 3760 GOSUB 5510
 3770 G(Q1,Q2)=(K3*100)+(B3*10)+S3
 3780 RETURN
 3790 IF C$ <> "DOCKED" THEN 3820
 3800 PRINT "STAR BASE SHIELDS PROTECT THE ENTERPRISE"
 3810 RETURN
 3820 IF K3 <= 0 THEN 3910
 3830 FOR I=1 TO 3
 3840   IF K(I,3) <= 0 THEN 3900
 3850   H=(K(I,3)/FND(0))*(2*RND(1))
 3860   S=S-H
 3870   PRINT  INT(H);" UNIT HIT ON ENTERPRISE AT SECTOR ";K(I,1);",";K(I,2);"   ( ";INT(S);" LEFT)"
 3880   REM IMAGE  4D," UNIT HIT ON ENTERPRISE AT SECTOR ",D,",",D,"   (",4D," LEFT)"
 3890   IF S<0 THEN 4000
 3900 NEXT I
 3910 RETURN
 3920 PRINT "THE ENTERPRISE IS DEAD IN SPACE.  IF YOU SURVIVE ALL IMPENDING"
 3930 PRINT "ATTACK YOU WILL BE DEMOTED TO THE RANK OF PRIVATE"
 3940 IF K3 <= 0 THEN 4020
 3950 GOSUB 3790
 3960 GOTO 3940
 3970 PRINT
 3980 PRINT "IT IS STARDATE ";T
 3990 GOTO 4020
 4000 PRINT
 4010 PRINT "THE ENTERPRISE HAS BEEN DESTROYED.  THE FEDERATION WILL BE CONQUERED"
 4020 PRINT "THERE ARE STILL ";K9;" KLINGON BATTLE CRUISERS"
 4030 GOTO 230
 4040 PRINT
 4050 PRINT "THE LAST KLINGON BATTLE CRUISER IN THE GALAXY HAS BEEN DESTROYED"
 4060 PRINT "THE FEDERATION HAS BEEN SAVED !!!"
 4070 PRINT
 4080 PRINT "YOUR EFFICIENCY RATING = ";((K7/(T-T0))*1000)
 4090 T1=(VAL(MID$(TIME$,17,2))*60)+VAL(MID$(TIME$,20,2))
 4100 PRINT "YOUR ACTUAL TIME OF MISSION = ";INT((((T1-T7)*.4)-T7)*100)" MINUTES"
 4110 GOTO 230
 4120 FOR I=S1-1 TO S1+1
 4130   FOR J=S2-1 TO S2+1
 4140     IF I<1 OR I>8 OR J<1 OR J>8 THEN 4200
 4150     A$=">!<"
 4160     Z1=I
 4170     Z2=J
 4180     GOSUB 5680
 4190     IF Z3=1 THEN 4240
 4200   NEXT J
 4210 NEXT I
 4220 D0=0
 4230 GOTO 4310
 4240 D0=1
 4250 C$="DOCKED"
 4260 E=3000
 4270 P=10
 4280 PRINT "SHIELDS DROPPED FOR DOCKING PURPOSES"
 4290 S=0
 4300 GOTO 4380
 4310 IF K3>0 THEN 4350
 4320 IF E<E0*.1 THEN 4370
 4330 C$="GREEN"
 4340 GOTO 4380
 4350 C$="RED"
 4360 GOTO 4380
 4370 C$="YELLOW"
 4380 IF D(2) >= 0 THEN 4430
 4390 PRINT
 4400 PRINT "*** SHORT RANGE SENSORS ARE OUT ***"
 4410 PRINT
 4420 GOTO 4530
 4430 PRINT  "---------------------------------"
 4440 PRINT  " ";MID$(Q$,1,3);" ";MID$(Q$,4,3);" ";MID$(Q$,7,3);" ";MID$(Q$,10,3);" ";MID$(Q$,13,3);" ";MID$(Q$,16,3);" ";MID$(Q$,19,3);" ";MID$(Q$,22,3);" "
 4450 PRINT  " ";MID$(Q$,25,3);" ";MID$(Q$,28,3);" ";MID$(Q$,31,3);" ";MID$(Q$,34,3);" ";MID$(Q$,37,3);" ";MID$(Q$,40,3);" ";MID$(Q$,43,3);" ";MID$(Q$,46,3);"        STARDATE        ";RIGHT$("     "+STR$(INT(T)),5)
 4460 PRINT  " ";MID$(Q$,49,3);" ";MID$(Q$,52,3);" ";MID$(Q$,55,3);" ";MID$(Q$,58,3);" ";MID$(Q$,61,3);" ";MID$(Q$,64,3);" ";MID$(Q$,67,3);" ";MID$(Q$,70,3);"        CONDITION        ";LEFT$(C$+"      ",6)
 4470 PRINT  " ";MID$(R$,1,3);" ";MID$(R$,4,3);" ";MID$(R$,7,3);" ";MID$(R$,10,3);" ";MID$(R$,13,3);" ";MID$(R$,16,3);" ";MID$(R$,19,3);" ";MID$(R$,22,3);"        QUADRANT         ";Q1;",";Q2
 4480 PRINT  " ";MID$(R$,25,3);" ";MID$(R$,28,3);" ";MID$(R$,31,3);" ";MID$(R$,34,3);" ";MID$(R$,37,3);" ";MID$(R$,40,3);" ";MID$(R$,43,3);" ";MID$(R$,46,3);"        SECTOR           ";S1;",";S2
 4490 PRINT  " ";MID$(R$,49,3);" ";MID$(R$,52,3);" ";MID$(R$,55,3);" ";MID$(R$,58,3);" ";MID$(R$,61,3);" ";MID$(R$,64,3);" ";MID$(R$,67,3);" ";MID$(R$,70,3);"        ENERGY         ";RIGHT$("      "+STR$(INT(E)),6)
 4500 PRINT  " ";MID$(S$,1,3);" ";MID$(S$,4,3);" ";MID$(S$,7,3);" ";MID$(S$,10,3);" ";MID$(S$,13,3);" ";MID$(S$,16,3);" ";MID$(S$,19,3);" ";MID$(S$,22,3);"        PHOTON TORPEDOES";RIGHT$("   "+STR$(INT(P)),3)
 4510 PRINT  " ";MID$(S$,25,3);" ";MID$(S$,28,3);" ";MID$(S$,31,3);" ";MID$(S$,34,3);" ";MID$(S$,37,3);" ";MID$(S$,40,3);" ";MID$(S$,43,3);" ";MID$(S$,46,3);"        SHIELDS        ";RIGHT$("      "+STR$(INT(S)),6)
 4520 PRINT  "---------------------------------"
 4530 RETURN
 4540 IMAGE  "---------------------------------"
 4550 IMAGE  8(X,3A)
 4560 IMAGE  8(X,3A),8X,"STARDATE",8X,5D
 4570 IMAGE  8(X,3A),8X,"CONDITION",8X,6A
 4580 IMAGE  8(X,3A),8X,"QUADRANT",9X,D,",",D
 4590 IMAGE  8(X,3A),8X,"SECTOR",11X,D,",",D
 4600 IMAGE  8(X,3A),8X,"ENERGY",9X,6D
 4610 IMAGE  8(X,3A),8X,"PHOTON TORPEDOES",3D
 4620 IMAGE  8(X,3A),8X,"SHIELDS",8X,6D
 4630 IF D(8) >= 0 THEN 4660
 4640 PRINT "COMPUTER DISABLED"
 4650 GOTO 1270
 4660 PRINT "COMPUTER ACTIVE AND AWAITING COMMAND";
 4670 INPUT A
 4680 IF A=0 GOTO 4740
 4681 IF A=1 GOTO 4830
 4682 IF A=2 GOTO 4880
 4690 PRINT "FUNCTIONS AVAILABLE FROM COMPUTER"
 4700 PRINT "   0 = CUMULATIVE GALACTIC RECORD"
 4710 PRINT "   1 = STATUS REPORT"
 4720 PRINT "   2 = PHOTON TORPEDO DATA"
 4730 GOTO 4660
 4740 PRINT  "COMPUTER RECORD OF GALAXY FOR QUADRANT ";Q1;",";Q2
 4750 REM IMAGE  "COMPUTER RECORD OF GALAXY FOR QUADRANT ",D,",",D
 4760 PRINT  "     1     2     3     4     5     6     7     8"
 4770 PRINT  "   ----- ----- ----- ----- ----- ----- ----- -----"
 4780 FOR I=1 TO 8
 4790   PRINT  STR$(I);"   ";RIGHT$("  "+STR$(Z(I,1)),3);"   ";RIGHT$("  "+STR$(Z(I,2)),3);"   ";RIGHT$("  "+STR$(Z(I,3)),3);"   ";RIGHT$("  "+STR$(Z(I,4)),3);
 4791   PRINT  "   ";RIGHT$("  "+STR$(Z(I,5)),3);"   ";RIGHT$("  "+STR$(Z(I,6)),3);"   ";RIGHT$("  "+STR$(Z(I,7)),3);"   ";RIGHT$("  "+STR$(Z(I,8)),3)
 4800   PRINT  "   ----- ----- ----- ----- ----- ----- ----- -----"
 4810 NEXT I
 4820 GOTO 1270
 4830 PRINT "\012   STATUS REPORT\012"
 4840 PRINT "NUMBER OF KLINGONS LEFT = ";K9
 4850 PRINT "NUMBER OF STARDATES LEFT = ";(T0+T9)-T
 4860 PRINT "NUMBER OF STARBASES LEFT = ";B9
 4870 GOTO 3560
 4880 PRINT
 4890 H8=0
 4900 FOR I=1 TO 3
 4910   IF K(I,3) <= 0 THEN 5260
 4920   C1=S1
 4930   A=S2
 4940   W1=K(I,1)
 4950   X=K(I,2)
 4960   GOTO 5010
 4970   PRINT  "YOU ARE AT QUADRANT ( ";Q1;",";Q2;" )  SECTOR ( ";S1;",";S2;" )"
 4980   REM IMAGE  "YOU ARE AT QUADRANT ( ",D,",",D," )  SECTOR ( ",D,",",D," )"
 4990   PRINT "SHIP'S & TARGET'S COORDINATES ARE";
 5000   INPUT C1,A,W1,X
 5010   X=X-A
 5020   A=C1-W1
 5030   IF X<0 THEN 5130
 5040   IF A<0 THEN 5190
 5050   IF X>0 THEN 5070
 5060   IF A=0 THEN 5150
 5070   C1=1
 5080   IF ABS(A) <= ABS(X) THEN 5110
 5090   PRINT "DIRECTION = ";C1+(((ABS(A)-ABS(X))+ABS(A))/ABS(A))
 5100   GOTO 5240
 5110   PRINT "DIRECTION = ";C1+(ABS(A)/ABS(X))
 5120   GOTO 5240
 5130   IF A>0 THEN 5170
 5140   IF X=0 THEN 5190
 5150   C1=5
 5160   GOTO 5080
 5170   C1=3
 5180   GOTO 5200
 5190   C1=7
 5200   IF ABS(A) >= ABS(X) THEN 5230
 5210   PRINT "DIRECTION = ";C1+(((ABS(X)-ABS(A))+ABS(X))/ABS(X))
 5220   GOTO 5240
 5230   PRINT "DIRECTION = ";C1+(ABS(X)/ABS(A))
 5240   PRINT "DISTANCE = ";(SQR(X^2+A^2))
 5250   IF H8=1 THEN 5320
 5260 NEXT I
 5270 H8=0
 5280 PRINT "DO YOU WANT TO USE THE CALCULATOR";
 5290 INPUT A$
 5300 IF A$="YES" THEN 4970
 5310 IF A$ <> "NO" THEN 5280
 5320 GOTO 1270
 5330 IMAGE  "     1     2     3     4     5     6     7     8"
 5340 IMAGE  "---------------------------------------------------"
 5350 IMAGE  D,8(3X,3D)
 5360 IMAGE  "   ----- ----- ----- ----- ----- ----- ----- -----"
 5370 IMAGE  " WARP ENGINES SHUTDOWN AT SECTOR ";D;",";D;" DUE TO BAD NAVIGATION"
 5380 R1=INT(RND(1)*8+1)
 5390 R2=INT(RND(1)*8+1)
 5400 A$="   "
 5410 Z1=R1
 5420 Z2=R2
 5430 GOSUB 5680
 5440 IF Z3=0 THEN 5380
 5450 RETURN
 5460 FOR I=1 TO 11
 5470   PRINT
 5480 NEXT I
 5490 PRINT
 5500 RETURN
 5510 REM ******  INSERTION IN STRING ARRAY FOR QUADRANT ******
 5520 S8=(Z1*24)+(Z2*3)-26
 5521 REM PRINT "A$: ";A$
 5522 REM PRINT "S8 insertion: ";S8
 5530 IF S8>72 THEN 5560
 5540 MID$(Q$,S8,3)=A$
 5550 GOTO 5600
 5560 IF S8>144 THEN 5590
 5570 MID$(R$,S8-72,3)=A$
 5580 GOTO 5600
 5590 MID$(S$,S8-144,3)=A$
 5600 RETURN
 5610 REM ****  PRINTS DEVICE NAME FROM ARRAY *****
 5620 S8=(R1*12)-11
 5630 IF S8>72 THEN 5660
 5640 PRINT MID$(D$,S8,11);
 5650 GOTO 5670
 5660 PRINT MID$(E$,S8-72,11);
 5670 RETURN
 5680 REM *******  STRING COMPARISON IN QUADRANT ARRAY **********
 5683 Z1=INT(Z1+.5)
 5686 Z2=INT(Z2+.5)
 5690 S8=(Z1*24)+(Z2*3)-26
 5700 Z3=0
 5710 IF S8>72 THEN 5750
 5720 IF MID$(Q$,S8,3) <> A$ THEN 5810
 5730 Z3=1
 5740 GOTO 5810
 5750 IF S8>144 THEN 5790
 5760 IF MID$(R$,S8-72,3) <> A$ THEN 5810
 5770 Z3=1
 5780 GOTO 5810
 5790 IF MID$(S$,S8-144,3) <> A$ THEN 5810
 5800 Z3=1
 5810 RETURN
 5820 PRINT "     INSTRUCTIONS:"
 5830 PRINT "<*> = ENTERPRISE"
 5840 PRINT "+++ = KLINGON"
 5850 PRINT ">!< = STARBASE"
 5860 PRINT " *  = STAR"
 5870 PRINT "COMMAND 0 = WARP ENGINE CONTROL"
 5880 PRINT "  'COURSE' IS IN A CIRCULAR NUMERICAL          4  3  2"
 5890 PRINT "  VECTOR ARRANGEMENT AS SHOWN.                  \ ^ /"
 5900 PRINT "  INTERGER AND REAL VALUES MAY BE                \^/"
 5910 PRINT "  USED.  THEREFORE COURSE 1.5 IS              5 ----- 1"
 5920 PRINT "  HALF WAY BETWEEN 1 AND 2.                      /^\"
 5930 PRINT "                                                / ^ \"
 5940 PRINT "  A VECTOR OF 9 IS UNDEFINED, BUT              6  7  8"
 5950 PRINT "  VALUES MAY APPROACH 9."
 5960 PRINT "                                               COURSE"
 5970 PRINT "  ONE 'WARP FACTOR' IS THE SIZE OF"
 5980 PRINT "  ONE QUADRANT.  THEREFORE TO GET"
 5990 PRINT "  FROM QUADRANT 6,5 TO 5,5 YOU WOULD"
 6000 PRINT "  USE COURSE 3, WARP FACTOR 1"
 6010 PRINT "COMMAND 1 = SHORT RANGE SENSOR SCAN"
 6020 PRINT "  PRINTS THE QUADRANT YOU ARE CURRENTLY IN, INCLUDING"
 6030 PRINT "  STARS, KLINGONS, STARBASES, AND THE ENTERPRISE; ALONG"
 6040 PRINT "  WITH OTHER PERTINATE INFORMATION."
 6050 PRINT "COMMAND 2 = LONG RANGE SENSOR SCAN"
 6060 PRINT "  SHOWS CONDITIONS IN SPACE FOR ONE QUADRANT ON EACH SIDE"
 6070 PRINT "  OF THE ENTERPRISE IN THE MIDDLE OF THE SCAN.  THE SCAN"
 6080 PRINT "  IS CODED IN THE FORM XXX, WHERE THE UNITS DIGIT IS THE"
 6090 PRINT "  NUMBER OF STARS, THE TENS DIGIT IS THE NUMBER OF STAR-"
 6100 PRINT "  BASES, THE HUNDREDS DIGIT IS THE NUMBER OF KLINGONS."
 6110 PRINT "COMMAND 3 = PHASER CONTROL"
 6120 PRINT "  ALLOWS YOU TO DESTROY THE KLINGONS BY HITTING HIM WITH"
 6130 PRINT "  SUITABLY LARGE NUMBERS OF ENERGY UNITS TO DEPLETE HIS "
 6140 PRINT "  SHIELD POWER.  KEEP IN MIND THAT WHEN YOU SHOOT AT"
 6150 PRINT "  HIM, HE GONNA DO IT TO YOU TOO."
 6160 PRINT "COMMAND 4 = PHOTON TORPEDO CONTROL"
 6170 PRINT "  COURSE IS THE SAME AS USED IN WARP ENGINE CONTROL"
 6180 PRINT "  IF YOU HIT THE KLINGON, HE IS DESTROYED AND CANNOT FIRE"
 6190 PRINT "  BACK AT YOU.  IF YOU MISS, HE WILL SHOOT HIS PHASERS AT"
 6200 PRINT "  YOU."
 6210 PRINT "   NOTE: THE LIBRARY COMPUTER (COMMAND 7) HAS AN OPTION"
 6220 PRINT "   TO COMPUTE TORPEDO TRAJECTORY FOR YOU (OPTION 2)."
 6230 PRINT "COMMAND 5 = SHIELD CONTROL"
 6240 PRINT "  DEFINES NUMBER OF ENERGY UNITS TO BE ASSIGNED TO SHIELDS"
 6250 PRINT "  ENERGY IS TAKEN FROM TOTAL SHIP'S ENERGY."
 6260 PRINT "COMMAND 6 = DAMAGE CONTROL REPORT"
 6270 PRINT "  GIVES STATE OF REPAIRS OF ALL DEVICES.  A STATE OF REPAIR"
 6280 PRINT "  LESS THAN ZERO SHOWS THAT THAT DEVICE IS TEMPORARALY"
 6290 PRINT "  DAMAGED."
 6300 PRINT "COMMAND 7 = LIBRARY COMPUTER"
 6310 PRINT "  THE LIBRARY COMPUTER CONTAINS THREE OPTIONS:"
 6320 PRINT "    OPTION 0 = CUMULATIVE GALACTIC RECORD"
 6330 PRINT "     SHOWS COMPUTER MEMORY OF THE RESULTS OF ALL PREVIOUS"
 6340 PRINT "     LONG RANGE SENSOR SCANS"
 6350 PRINT "    OPTION 1 = STATUS REPORT"
 6360 PRINT "     SHOWS NUMBER OF KLINGONS, STARDATES AND STARBASES"
 6370 PRINT "     LEFT."
 6380 PRINT "    OPTION 2 = PHOTON TORPEDO DATA"
 6390 PRINT "     GIVES TRAJECTORY AND DISTANCE BETWEEN THE ENTERPRISE"
 6400 PRINT "     AND ALL KLINGONS IN YOUR QUADRANT"
 6410 RETURN
 7000 DEF PROC_tprint(P$)
 7001 REM experimental code to simulate teletype/slow VDU but not used at moment
 7010 FOR loop=1 TO LEN(P$)
 7020   PRINT MID$(P$,loop,1);
 7030   WAIT w
 7040 NEXT loop
 7199 ENDPROC
 9999 END

Instructions repeated as too long for screen in game as intended to run on a teletype

      INSTRUCTIONS:
<*> = ENTERPRISE
+++ = KLINGON
>!< = STARBASE
 *  = STAR
 
COMMAND 0 = WARP ENGINE CONTROL
'COURSE' IS IN A CIRCULAR NUMERICAL          4  3  2
VECTOR ARRANGEMENT AS SHOWN.                  \ ^ /
INTERGER AND REAL VALUES MAY BE                \^/
USED.  THEREFORE COURSE 1.5 IS              5 ----- 1
HALF WAY BETWEEN 1 AND 2.                      /^\
                                              / ^ \
  A VECTOR OF 9 IS UNDEFINED, BUT            6  7  8
  VALUES MAY APPROACH 9.
                                              COURSE
  ONE 'WARP FACTOR' IS THE SIZE OF
  ONE QUADRANT.  THEREFORE TO GET
 FROM QUADRANT 6,5 TO 5,5 YOU WOULD
  USE COURSE 3, WARP FACTOR 1

COMMAND 1 = SHORT RANGE SENSOR SCAN
  PRINTS THE QUADRANT YOU ARE CURRENTLY IN, INCLUDING
  STARS, KLINGONS, STARBASES, AND THE ENTERPRISE; ALONG
  WITH OTHER PERTINATE INFORMATION.
  
COMMAND 2 = LONG RANGE SENSOR SCAN
  SHOWS CONDITIONS IN SPACE FOR ONE QUADRANT ON EACH SIDE
  OF THE ENTERPRISE IN THE MIDDLE OF THE SCAN.  THE SCAN
  IS CODED IN THE FORM XXX, WHERE THE UNITS DIGIT IS THE
  NUMBER OF STARS, THE TENS DIGIT IS THE NUMBER OF STAR-
  
COMMAND 3 = PHASER CONTROL
  ALLOWS YOU TO DESTROY THE KLINGONS BY HITTING HIM WITH
  SUITABLY LARGE NUMBERS OF ENERGY UNITS TO DEPLETE HIS 
  SHIELD POWER.  KEEP IN MIND THAT WHEN YOU SHOOT AT
  HIM, HE GONNA DO IT TO YOU TOO.
  
COMMAND 4 = PHOTON TORPEDO CONTROL
  COURSE IS THE SAME AS USED IN WARP ENGINE CONTROL
  IF YOU HIT THE KLINGON, HE IS DESTROYED AND CANNOT FIRE
  BACK AT YOU.  IF YOU MISS, HE WILL SHOOT HIS PHASERS AT
  YOU.
   NOTE: THE LIBRARY COMPUTER (COMMAND 7) HAS AN OPTION
   TO COMPUTE TORPEDO TRAJECTORY FOR YOU (OPTION 2).
   
COMMAND 5 = SHIELD CONTROL
  DEFINES NUMBER OF ENERGY UNITS TO BE ASSIGNED TO SHIELDS
  ENERGY IS TAKEN FROM TOTAL SHIP'S ENERGY.
  
COMMAND 6 = DAMAGE CONTROL REPORT
  GIVES STATE OF REPAIRS OF ALL DEVICES.  A STATE OF REPAIR
  LESS THAN ZERO SHOWS THAT THAT DEVICE IS TEMPORARALY
  DAMAGED.
  
COMMAND 7 = LIBRARY COMPUTER
  THE LIBRARY COMPUTER CONTAINS THREE OPTIONS:
  
    OPTION 0 = CUMULATIVE GALACTIC RECORD
     SHOWS COMPUTER MEMORY OF THE RESULTS OF ALL PREVIOUS
     LONG RANGE SENSOR SCANS
     
    OPTION 1 = STATUS REPORT
     SHOWS NUMBER OF KLINGONS, STARDATES AND STARBASES
     LEFT.
     
    OPTION 2 = PHOTON TORPEDO DATA
     GIVES TRAJECTORY AND DISTANCE BETWEEN THE ENTERPRISE
     AND ALL KLINGONS IN YOUR QUADRANT

You may also like...

Leave a Reply

Your email address will not be published.