image of READY prompt

Wang2200.org

Listing of file='STARTRKA' on disk='vmedia/games-droz00.wvd.zip'

# Sector 573, program filename = 'STARTRKA'
0180 REM 12/14/78 (TB0 REV)
   : PRINT HEX(03),,"****STARTREK****"
0190 PRINT "YOU ARE COMMANDER OF THE SPACESHIP 'ENTERPRISE'"
   : PRINT "<*>='ENTERPRISE'"
   : PRINT ">!<=STARBASES"
   : PRINT "+++=KLINGONS"
   : PRINT " * =STARS"
0230 DIM S$(8)33
0260 DIM D(10),G(8,8),C(9,2),K(3,3),N(3),Z(8,8)
0280 INIT(20)S$()
0290 T0,T=INT(RND(1)*20+20)*100
0300 T9=30
   : E0,E=3000
   : P=10
   : S9=200
   : B9,K9,S=0
0360 DEFFND(D)=SQR((K(I,1)-S1)^2+(K(I,2)-S2)^2)
0370 Q1=INT(RND(1)*8+1)
0380 Q2=INT(RND(1)*8+1)
0390 S1=INT(RND(1)*8+1)
0400 S2=INT(RND(1)*8+1)
0420 C(2,1),C(3,1),C(4,1),C(4,2),C(5,2),C(6,2)=-1
0430 C(1,1),C(3,2),C(5,1),C(7,2),C(9,1)=0
0440 C(1,2),C(2,2),C(6,1),C(7,1),C(8,1),C(8,2),C(9,2)=1
0460 DATA "WARP ENGINES","S.R.SENSORS","L.R.SENSORS","PHASER CONTR0L"
0480 DATA "PHOTON TUBES","DAMAGE CONTROL","SHIELD CONTROL","COMPUTER"
0500 FOR I=1TO 8
   : FOR J=1TO 8
0520 R1=RND(1)
   : K3=3
   : IF R1>.98THEN 660
   : K3=2
   : IF R1>.95THEN 660
   : K3=1
   : IF R1>.8THEN 660
   : K3=0
0660 K9=K9+K3
   : B3=1
   : IF RND(1)>.96THEN 700
   : B3=0
0700 B9=B9+B3
   : S3=INT(RND(1)*8+1)
   : G(I,J)=K3*100+B3*10+S3
   : Z(I,J)=0
0750 NEXT J
   : NEXT I
   : K7=K9
0780 PRINT  "YOU MUST DESTROY";K9;"KLINGONS IN ";T9;"STARDATES WITH";B9;"STARB
     ASES"
0790 IF B9>0 THEN 810
   : G(6,3)=114
0810 K3,B3,S3=0
0820 IF Q1<1THEN 920
   : IF Q1>8THEN 920
   : IF Q2<1THEN 920
   : IF Q2>8THEN 920
0830 X=G(Q1,Q2)*.01
   : K3=INT(X)
   : B3=INT((X-K3)*10)
0860 S3=G(Q1,Q2)-INT(G(Q1,Q2)*.1)*10
0870 IF K3=0 THEN 901
   : IF S>200THEN 901
0890 PRINT "COMBAT AREA CONDITION RED"
0900 PRINT  "SHIELDS DANGEROUSLY LOW"
0901 FOR I=1TO 3
   : K(I,1),K(I,2)=0
   : NEXT I
0920 K(1,3),K(2,3),K(3,3)=0
0950 FOR I=1 TO 8
   : S$(I)=" "
   : NEXT I
0980 A$="<*>"
   : Z1=S1
   : Z2=S2
   : GOSUB 5510
1020 IF K3=0THEN 1115
   : FOR I=1TO K3
   : GOSUB 5380
   : A$="+++"
   : GOSUB 5500
   : K(I,1)=R1
   : K(I,2)=R2
   : K(I,3)=S9
   : NEXT I
1115 IF B3=0THEN 1185
   : FOR I=1TO B3
   : GOSUB 5380
   : A$=">!<"
   : GOSUB 5500
   : NEXT I
1185 IF S3=0THEN 1260
   : FOR I=1TO S3
   : GOSUB 5380
   : A$=" * "
   : GOSUB 5500
   : NEXT I
1260 GOSUB 4120
   : GOTO 1310
   : REM %COMMAND
1275 PRINT "COMMAND";
   : INPUT A
1290 ON A+1 GOTO 1410, 1260, 2330, 2530, 2800, 3460, 3560, 4630
1300 DEFFN'0
1310 PRINT " 0 = SET COURSE  4 = FIRE PHOTON TORPEDOS","DIRECTION"
1320 PRINT " 1 = S.R. SENSOR SCAN  5 = SHIELDS CONTROL"," 4  3  2"
1330 PRINT " 2 = L.R. SENSOR SCAN  6 = DAMAGE CONTROL"," 5  E  1"
1340 PRINT " 3 = FIRE PHASERS  7 = CALL ON COMPUTER"," 6  7  8"
1400 GOTO 1275
   : %SET COURSE
1410 INPUT "COURSE (1-8)",C1
1430 IF C1=0THEN 1310
   : IF C1<1THEN 1410
   : IF C1>9THEN 1410
1450 INPUT " WARP FACTOR (0-8)",W1
1470 IF W1<0THEN 1410
   : IF W1>8THEN 1410
1480 IF D(1) >=0 THEN 1510
   : IF W1 <=.2 THEN 1510
1490 PRINT  " WARP ENGINES ARE DAMAGED, MAXIMUM SPEED = WARP .2"
   : GOTO 1410
1510 IF K3<=0THEN 1560
   : GOSUB 3790
   : IF S<0THEN 4000
   : GOTO 1610
1560 IF E>0 THEN 1610
   : IF S<1THEN 3920
1580 PRINT "YOU HAVE";E;"UNITS OF ENERGY"
1590 PRINT  " SUGGEST YOU GET SOME FROM YOUR SHIELDS WHICH HAVE";S;"UNITS LEFT
     "
   : GOTO 1275
1610 FOR I=1 TO 8
   : IF D(I)>=0 THEN 1640
   : D(I)=D(I)+1
1640 NEXT I
1650 IF RND(1)>.2THEN 1810
1660 R1=INT(RND(1)*8+1)
   : PRINT
   : PRINT "DAMAGE CONTROL REPORT:";
   : GOSUB 5610
1670 IF RND(1)>=.5 THEN 1750
1680 D(R1)=D(R1)-(RND(1)*5+1)
1690 PRINT "DAMAGED"
   : PRINT
   : GOTO 1810
1750 PRINT
   : D(R1)=D(R1)+(RND(1)*5+1)
   : IF D(R1)>0THEN 1755
   : PRINT "STATE OF REPAIR IMPROVED"
   : GOTO 1810
1755 PRINT "POSITIVE CONDITION"
1810 N=INT(W1*8)
   : A$="   "
   : X,Z1=S1
   : Y,Z2=S2
   : GOSUB 5510
1890 GOSUB 5830
1905 IF N=0THEN 2080
   : I=1
1911 S1=S1+X1
   : S2=S2+X2
1940 IF S1<1THEN 2170
   : IF S1>=9THEN 2170
   : IF S2<1THEN 2170
   : IF S2>=9THEN 2170
1950 S8=INT(S1*8+S2-8)
1970 IF STR(S$(S1),S2*4-3,3)="   "THEN 2070
2030 PRINT "WARP ENGINES SHUT DOWN AT SECTOR";S1;",";S2;"DUE TO BAD NAVAGATION
     "
2040 S1=S1-X1
   : S2=S2-X2
   : GOTO 2080
2070 I=I+1
   : IF I<=N THEN 1911
2080 A$="<*>"
   : Z1=S1
   : Z2=S2
   : GOSUB 5510
   : E=E-N+5
   : IF W1<1THEN 2150
   : T=T+1
2150 IF T>T0+T9 THEN 3970
   : GOTO 1260
2170 X=Q1*8+X+X1*N
   : Y=Q2*8+Y+X2*N
2190 Q1=INT(X/8)
   : Q2=INT(Y/8)
   : S1=INT(X-Q1*8)
   : S2=INT(Y-Q2*8)
2230 IF S1<>0 THEN 2260
2240 Q1=Q1-1
   : S1=8
2260 IF S2<>0 THEN 2290
2270 Q2=Q2-1
   : S2=8
2290 T=T+1
   : E=E-N+5
2310 IF T>T0+T9 THEN 3970
   : GOTO 810
   : %L.R. SENSOR SCAN
2330 IF D(3)>= 0  THEN 2370
2340 PRINT  "LONG RANGE SENSOR SCANS ARE INOPERABLE"
   : GOTO 1275
2370 PRINT HEX(03);"LONG RANGE SENSOR SCAN FOR QUADRANT";Q1;",";Q2
2375 PRINT "DISPLAY FORM=XYZ",,"X=KLINGONS  Y=STARBASES  Z=STARS"
2378 GOSUB 4437
   : PRINT HEX(010A0A0A)
2380 PRINT  "-------------------"
2390 FOR I= Q1-1 TO Q1+1
2400 N(1),N(2),N(3)=0
2410 FOR J= Q2-1 TO Q2+1
2420 IF I<1THEN 2460
   : IF I>8THEN 2460
   : IF J<1THEN 2460
   : IF J>8THEN 2460
2430 N(J-Q2+2)=G(I,J)
   : IF D(7)<0THEN 2460
   : Z(I,J)=G(I,J)
2460 NEXT J
2470 %###     ###     ###
2471 PRINTUSING 2470, N(1),N(2),N(3)
2480 PRINT "-------------------"
2490 NEXT I
   : GOTO 1310
   : %PHASERS
2530 IF K3<=0THEN 3670
   : IF D(4)>=0THEN 2570
   : PRINT "PHASERS ARE INOPERABLE"
   : GOTO 1275
2570 IF D(7)>=0 THEN 2590
2580 PRINT " COMPUTER FAILURE HAMPERS ACCURACY "
2590 PRINT  "PHASERS LOCKED ON TARGET. ENERGY AVAILABLE=";E
2600 INPUT "NUMBER OF UNITS TO FIRE:",X
2620 IF X<=0THEN 1310
2630 IF E-X<0 THEN 2570
   : E=E-X
   : GOSUB 3790
2660 IF D(7) >=0 THEN 2680
2670 X=X*RND(1)
2680 FOR I=1TO 3
2690 IF K(I,3)<=0 THEN 2770
2700 H=INT((X/K3/FND(0))*(2*RND(1)))
2710 K(I,3)=K(I,3)-H
2720 PRINT H;"UNIT HIT ON KLINGON AT SECTOR";K(I,1);",";K(I,2);
2721 PRINT  "  (";K(I,3);"LEFT)"
2740 IF K(I,3)>0THEN 2770
   : GOSUB 3690
   : IF K9<=0THEN 4040
2770 NEXT I
2780 IF E<0 THEN 4000
   : GOTO 1275
   : %PHOTONS
2800 IF D(5) >=0 THEN 2830
2810 PRINT  " PHOTON TUBES ARE NOT OPERATIONAL"
   : GOTO 1275
2830 IF P>0 THEN 2860
   : PRINT "ALL PHOTON TORPEDOES EXPENDED"
   : GOTO 1275
2860 C1=C
   : INPUT "TORPEDO COURSE(1-9):",C1
2880 IF C1=0THEN 1310
2890 IF C1<1THEN 2860
   : IF C1>9THEN 2860
2900 GOSUB 5830
2920 X=S1
   : Y=S2
   : P=P-1
2950 PRINT "TORPEDO  TRACK:"
2960 X=X+X1
   : Y=Y+X2
2980 IF X<1THEN 3420
   : IF X>=9THEN 3420
   : IF Y<1THEN 3420
   : IF Y>=9THEN 3420
2990 PRINT "   ";X;",";Y
3010 A$="   "
   : GOSUB 5675
3040 IF Z3=0THEN 3070
   : GOTO 2960
3070 A$="+++"
   : GOSUB 5675
   : IF Z3=0THEN 3220
3120 PRINT "***KLINGON DESTROYED***"
   : K3=K3-1
   : K9=K9-1
   : IF K9<=0THEN 4040
   : I=1
3161 IF INT(X)<>K(I,1) THEN 3190
   : IF INT(Y)=K(I,2)THEN 3200
3190 I=I+1
   : IF I<=3THEN 3161
   : I=I-1
3200 K(I,3)=0
   : GOTO 3360
3220 A$=" * "
   : GOSUB 5675
3260 IF Z3=0 THEN 3290
   : PRINT "YOU CAN'T DESTROY STARS SILLY"
   : GOTO 3420
3290 A$=">!<"
   : Z1=X
   : Z2=Y
   : GOSUB 5680
3330 IF Z3=0 THEN 2960
3340 PRINT "*** STARBASE DESTROYED ***......CONGRATULATIONS"
   : B3=B3-1
3360 A$="   "
   : Z1=X
   : Z2=Y
   : GOSUB 5510
3400 G(Q1,Q2) =K3*100+B3*10+S3
   : GOTO 3430
3420 PRINT "TORPEDO MISSED"
3430 GOSUB 3790
   : IF E<0THEN 4000
   : GOTO 1275
   : %SHIELDS
3460 IF D(7)>=0 THEN 3490
3470 PRINT "SHIELD CONTROL IS NON -OPERATIONAL"
   : GOTO 1275
3490 PRINT "ENERGY AVAILABLE=";E+S
3500 INPUT "NUMBER OF UNITS TO SHIELDS:",X
3510 IF X<=0THEN 3490
   : IF E+7-X<0THEN 3490
   : E=E+S-X
   : S=X
   : GOTO 1310
   : %DAMAGE CONTROL
3560 IF D(6) >=0 THEN 3590
3570 PRINT "DAMAGE CONTROL REPORT IS NOT AVAILABLE"
   : GOTO 1275
3590 PRINT
   : PRINT "DEVICE    STATE OF REPAIR"
3610 FOR R1=1TO 8
   : GOSUB 5610
   : PRINT " ";
   : IF D(R1)<0THEN 3640
   : PRINT "OK"
   : GOTO 3650
3640 PRINT D(R1)
3650 NEXT R1
   : PRINT
   : GOTO 1275
3670 PRINT "SHORT RANGE SENSORS REPORT NO KLINGONS IN THIS QUADRANT"
   : GOTO 1275
3690 PRINT "KLINGON AT SECTOR ";K(I,1);",";K(I,2);"DESTROYED***"
3710 K3=K3-1
   : K9=K9-1
   : A$="   "
   : Z1=K(I,1)
   : Z2=K(I,2)
   : GOSUB 5510
3770 G(Q1,Q2)=K3*100+B3*10+S3
   : RETURN
3790 IF C$<> "DOCKED"THEN 3820
3800 PRINT "STARBASE SHIELDS PROTECT THE ENTERPRISE"
   : RETURN
3820 IF K3<=0 THEN 3910
   : I=1
3831 IF K(I,3)<=0 THEN 3900
3850 H=INT((K(I,3)/FND(0))*(2+RND(1)))
   : S=S-H
3870 PRINT H;"UNIT HIT ON ENTERPRISE AT SECTOR";K(I,1);",";K(I,2);
3871 PRINT "     (";S;"LEFT)"
3890 IF S<0 THEN 4000
3900 I=I+1
   : IF I<=3 THEN 3831
3910 RETURN
3920 PRINT "THE ENTERPRISE IS DEAD IN SPACE.  IF YOU SURVIVE ALL IMPENDING"
3930 PRINT "ATTACKS YOU WILL BE DEMOTED TO THE RANK OF PRIVATE"
3940 IF K3<=0 THEN 4020
   : GOSUB 3790
   : GOTO 3940
   : %END SUMMARY
3970 PRINT
   : PRINT "IT IS STARDATE";T
   : GOTO 4020
   : REM ****NO ENERGY LEFT
4000 PRINT
   : PRINT "THE ENTERPRISE HAS BEEN DESTROYED."
   : PRINT "THE FEDERATION WILL BE CONQUERED"
4020 PRINT "THERE ARE STILL";K9;"KLINGON BATTLE CRUISERS"
4030 PRINT
   : PRINT
   : GOTO 4100
4040 PRINT
   : PRINT "THE LAST KLINGON BATTLE CRUISER IN THE GALAXY HAS BEEN DESTROYED"
4050 PRINT "THE FEDERATION HAS BEEN SAVED!!!!"
   : PRINT
4080 PRINT "YOUR EFFICIENCY RATING =";((K7/(T-T0))*1000)
4100 PRINT "TIME OF MISSION =";T-T0;"STARDATES"
4105 STOP "KEY  RUN (EXEC) TO TRY AGAIN"
   : %^DISPLAY
4120 I=S1-1
4130 J=S2-1
4140 IF I<1THEN 4200
   : IF I>8THEN 4200
   : IF J<1THEN 4200
   : IF J>8THEN 4200
4150 A$=">!<"
   : Z1=I
   : Z2=J
4180 GOSUB 5680
4190 IF Z3=1 THEN 4240
4200 J=J+1
   : IF J<=S2+1 THEN 4140
4210 I=I+1
   : IF I<=S1+1 THEN 4130
   : GOTO 4310
4240 C$="DOCKED"
   : E=E0
   : P=10
4280 PRINT "SHIELDS DROPPED FOR DOCKING PURPOSES"
   : S=0
   : GOTO 4380
4310 IF K3>0 THEN 4350
4320 C$="YELLOW"
   : IF E<E0*.1THEN 4380
   : C$="GREEN"
   : GOTO 4380
4350 C$= "RED"
4380 IF D(2)>=0THEN 4430
4390 PRINT
   : PRINT "SHORT RANGE SENSORS ARE OUT"
   : PRINT
   : RETURN
   : %^END OF DISPLAY S.R.
4430 PRINT HEX(03);"---- SHORT RANGE SENSOR SCAN ----"
4432 GOSUB 4437
   : GOTO 4445
4435 %################   ######
4436 %#############       # , #
4437 PRINT TAB(36);
   : PRINTUSING 4435,"STARDATE",T
4438 PRINT TAB(36);
   : PRINTUSING 4435,"CONDITION",C$
4439 PRINT TAB(36);
   : PRINTUSING 4436,"QUADRANT",Q1,Q2
4440 PRINT TAB(36);
   : PRINTUSING 4436,"SECTOR",S1,S2
4441 PRINT TAB(36);
   : PRINTUSING 4435,"TOTAL ENERGY",E
4442 PRINT TAB(36);
   : PRINTUSING 4435,"PHOTON TORPEDOES",P
4443 PRINT TAB(36);
   : PRINTUSING 4435,"SHIELDS",S
   : RETURN
4445 S8=1
   : PRINT HEX(010A)
4455 FOR I=1 TO 8
   : PRINT S$(I)
   : NEXT I
4520 PRINT "---------------------------------"
   : RETURN
   : %^COMPUTER
4630 IF D(8)>=0 THEN 4690
   : PRINT "COMPUTER DISABLED"
   : GOTO 1275
4690 PRINT "COMPUTER FUNCTIONS--","0=CUMULATIVE GALACTIC RECORD"
   : PRINT "1=STATUS REPORT",,"2=PHOTON TORPEDO DATA"
4730 GOTO 4732
   : %CUMULATIVE GALACTIC RECORD
4732 INPUT "COMPUTER ACTIVE AND AWAITING COMMAND",A
   : ON A+1GOTO 4740,4830,4880
   : GOTO 4690
4740 PRINT " COMPUTER RECORD OF GALAXY FOR QUADRANT";Q1;",";Q2
4760 PRINT "     1      2      3      4      5      6      7      8"
4770 PRINT "   -----  -----  -----  -----  -----  -----  -----  -----"
4780 FOR I = 1 TO 8
4790 % #- ###    ###    ###    ###    ###    ###    ###    ###
4795 PRINTUSING 4790,I,Z(I,1),Z(I,2),Z(I,3),Z(I,4),Z(I,5),Z(I,6),Z(I,7),Z(I,8)
4810 NEXT I
4815 PRINT "   -----  -----  -----  -----  -----  -----  -----  -----"
   : GOTO 1275
4830 PRINT "STATUS REPORT"
   : PRINT "NUMBER OF KLINGONS LEFT =";K9
   : PRINT "NUMBER OF STARDATES LEFT =";T0+T9-T
   : PRINT "NUMBER OF STARBASES LEFT =";B9
   : GOTO 3560
   : %PHOTON DATA
4880 IF D(5)<0THEN 2810
   : IF P=0THEN 2830
   : FOR I=1TO 3
   : IF K(I,3)<=0THEN 5260
   : C1=S1
   : A=S2
   : W1=K(I,1)
   : X=K(I,2)
   : PRINT "DIRECTION =";
5010 X=X-A
   : A=C1-W1
   : IF X<0THEN 5130
   : IF A<0THEN 5190
5050 IF X>0 THEN 5070
   : IF A=0THEN 5150
5070 C1=1
5080 IF ABS(A)<=ABS(X)THEN 5110
5085 C=(((ABS(A)-ABS(X))+ABS(A))/ABS(A))
   : GOTO 5240
5110 C=(ABS(A)/ABS(X))
   : GOTO 5240
5130 IF A > 0 THEN 5170
5140 IF X=0 THEN 5190
5150 C1=5
   : GOTO 5080
5170 C1=3
   : GOTO 5200
5190 C1=7
5200 IF ABS(A)>=ABS(X)THEN 5230
5210 C=(((ABS(X)-ABS(A))+ABS(X))/ABS(X))
   : GOTO 5240
5230 C=(ABS(X)/ABS(A))
5240 C=C+C1
   : PRINT C,"DISTANCE =";SQR(X^2+A^2)
5260 NEXT I
   : PRINT
   : GOTO 1310
   : %S.R.
5380 R1=INT(RND(1)*8+1)
   : R2=INT(RND(1)*8+1)
   : A$="   "
   : Z1=R1
   : Z2=R2
   : GOSUB 5680
5440 IF Z3=0 THEN 5380
   : RETURN
   : %S.R.
5500 Z1=R1
   : Z2=R2
5510 STR(S$(Z1),Z2*4-3,3)=A$
   : RETURN
5610 RESTORE R1
   : READ D$
   : PRINT D$,
   : RETURN
5675 Z1=X
   : Z2=Y
5680 Z3=0
   : IF STR(S$(Z1),Z2*4-3,3)<>STR(A$,1,3)THEN 5810
   : Z3=1
5810 RETURN
5820 REM .S.R.
5830 X1=C(C1,1)+(C(C1+1,1)-C(C1,1))*(C1-INT(C1))
5840 X2=C(C1,2)+(C(C1+1,2)-C(C1,2))*(C1-INT(C1))
5850 RETURN