iPad only
Code: Select all
10 text clear
11 randomize
SET ORIENTATION 2
210 PRINT CHR$(26)
220 PRINT TAB(20);"THE USS ENTERPRISE --- NCC-1701"
221 PRINT TAB(10);" ,------*------,"
222 PRINT TAB(10);" ,------------- '--- ------'"
223 PRINT TAB(10);" '-------- --' / /"
224 PRINT TAB(10);" )---' '-------/ /--,"
225 PRINT TAB(10);" ----------------'"
270 Z$="-----------------------------"
330 DIM G(10,10),C(10,4),K(5,5),N(5),Z(10,10),D(10)
370 T=INTeg(RND(1)*20+20)*100 ! T0=T ! T9=35+INTeg(RND(1)*10) ! D0=0 ! E=3000 ! E0=E
440 P=10 ! P0=P ! S9=100 ! S=0 ! B9=0 ! K9=0 ! X$="" ! X0$=" IS " ! offset = 0
475 DEF FNR(R)=INTeg(RND(R)*8)
490 Q1=FNR(1) ! Q2=FNR(1) ! S1=FNR(1) ! S2=FNR(1)
if q1<1 or q2<1 or s1<1 or s2<1 then 490
if q1>8 or q2>8 or s1>8 or s2>8 then 490
530 FOR I=1 TO 9 ! C(I,1)=0 ! C(I,2)=0 ! NEXT I
540 C(3,1)=-1 ! C(2,1)=-1 ! C(4,1)=-1 ! C(4,2)=-1 ! C(5,2)=-1 ! C(6,2)=-1
600 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
670 FOR I=1 TO 8 ! D(I)=0 ! NEXT I
820 FOR I=1 TO 8 ! FOR J=1 TO 8 ! K3=0 ! Z(I,J)=0 ! R1=RND(1)
850 IF R1>.98 THEN K3=3 ! IF R1>.98 THEN K9=K9+3 ! IF R1>.98 THEN GOTO 980
860 IF R1>.95 THEN K3=2 ! IF R1>.95 THEN K9=K9+2 ! IF R1>.95 THEN GOTO 980
870 IF R1>.8 THEN K3=1!IF R1>.8 THEN K9=K9+1
980 B3=0!IF RND(1)>.86 THEN B3=1!IF RND(1)>.86 THEN B9=B9+1
1040 G(I,J)=K3*100+B3*10+FNR(1) ! if g(i,j)=0 then g(i,j) = 1 ! NEXT J ! NEXT I ! IF K9>T9 THEN T9=K9+29
1100 IF B9<>0 THEN 1200
1150 IF G(Q1,Q2)<200 THEN G(Q1,Q2)=G(Q1,Q2)+100 ! IF G(Q1,Q2)<200 THEN K9=K9+1
1160 B9=1 ! G(Q1,Q2)=G(Q1,Q2)+10 ! Q1=FNR(1) ! Q2=FNR(1)
1200 K7=K9 ! IF B9<>1 THEN X$="S" ! IF B9<>1 THEN X0$=" ARE "
1230 PRINT "YOUR ORDERS ARE AS FOLLOWS!"
1235 PRINT "--------------------------"
1240 PRINT " DESTROY THE";K9;"KLINGON WARSHIPS WHICH HAVE INVADED"
1250 PRINT " THE GALAXY BEFORE THEY CAN ATTACK FEDERATION HEADQUARTERS"
1260 PRINT " ON STARDATE";T0+T9;CHR$(8);". THIS GIVES YOU";T9;"DAYS. THERE";X0$
1270 PRINT " ";B9;"STARBASE";X$;" IN THE GALAXY FOR RESUPPLYING YOUR SHIP."
1280 PRINT "ARE YOU READY TO ACCEPT COMMAND ('N' FOR INSTRUCTIONS)";
goto yesno
1310 button 0 hide ! button 1 hide ! PRINT CHR$(26)
1320 Z4=Q1!Z5=Q2!K3=0!B3=0!S3=0!G5=0!D4=.5*RND(1)!Z(Q1,Q2)=G(Q1,Q2)
1390 IF Q1<1 OR Q1>8 OR Q2<1 OR Q2>8 THEN 1600
1430 GOSUB 9030 ! IF T0<>T THEN 1490
text clear
1460 PRINT "YOUR MISSION BEGINS WITH YOUR STARSHIP LOCATED"
1470 PRINT "IN THE GALACTIC QUADRANT, '";G2$;"'."!GOTO 1500
1490 text clear ! PRINT "NOW ENTERING ";G2$;" QUADRANT . . ."
1500 X=G(Q1,Q2)*.01!K3=INTeg(X)!B3=INTeg((X-K3)*10.0)!S3=G(Q1,Q2)-INTeg(G(Q1,Q2)*.1)*10
1540 IF K3=0 THEN 1590
1560 PRINT TAB(3);CHR$(22);" COMBAT AREA CONDITION RED ";CHR$(22)!IF S>200 THEN PRINT! if s>200 then GOTO 1590
1580 PRINT TAB(3);CHR$(22);" SHIELDS DANGEROUSLY LOW ";CHR$(22)
1590 FOR I=1 TO 3!K(I,1)=0!K(I,2)=0!K(I,3)=0!NEXT I
1600 Q$=Z$&Z$&Z$&Z$&Z$&Z$&Z$&LEFT$(Z$,17)
1680 A$="<E>"!Z1=S1!Z2=S2!GOSUB 8670!IF K3<1 THEN 1820
1720 FOR I=1 TO K3!GOSUB 8590!A$="+K+"!Z1=R1!Z2=R2
1780 GOSUB 8670!K(I,1)=R1!K(I,2)=R2!K(I,3)=integ(S9*(.5+RND(1)))!NEXT I
1820 IF B3<1 THEN 1910
1880 GOSUB 8590!A$=">B<"!Z1=R1!B4=R1!Z2=R2!B5=R2!GOSUB 8670
1910 FOR I=1 TO S3!GOSUB 8590!A$="-*-"!Z1=R1!Z2=R2!GOSUB 8670!NEXT I
goto 1980
1979 text clear
1980 GOSUB 6430
1990 IF S+E>10 and E>10 OR D(7)=0 THEN 2060
2020 PRINT TAB(10);CHR$(22);"** FATAL ERROR **";CHR$(22)!PRINT "YOU'VE JUST STRANDED YOUR SHIP IN SPACE."
2030 PRINT "YOU HAVE INSUFFICIENT MANEUVERING ENERGY,"
2040 PRINT "AND SHIELD CONTROL IS PRESENTLY INCAPABLE OF"
2050 PRINT "CROSS-CIRCUITING TO ENGINE ROOM!!"!GOTO 6220
2060 goto cmds
2300 gosub butclr ! gosub course ! c1= integ(c1) ! if c1 = 0 then 1990
2350 X$="8"!IF D(1)<0 THEN X$="0.2"
2360 PRINT "WARP FACTOR (0-";X$;")"
IF D(1)<0 THEN gosub reduce else gosub full
IF D(1)<0 AND W1>.2 THEN 2470
2380 IF W1>0 AND W1<=8 THEN 2490
2390 IF W1=0 THEN 1990
2420 PRINT " CHIEF ENGINEER SCOTT! 'THE ENGINES WON'T TAKE";
2430 PRINT " WARP";W1;CHR$(8);"!'"!GOTO 1990
2470 PRINT "WARP ENGINES ARE DAMAGED. MAXIUM SPEED = WARP 0.2"!GOTO 1990
2490 N3=INTeg(W1*8)!IF E-N3>=0 THEN 2590
2500 PRINT "ENGINEERING! 'INSUFFICIENT ENERGY AVAILABLE"
2510 PRINT " FOR MANEUVERING AT WARP";W1;CHR$(8);"!'"
2530 IF S<N-E OR D(7)<0 THEN 1990
2550 PRINT "DEFLECTOR CONTROL ROOM! ";S;"UNITS OF ENERGY"
2560 PRINT " PRESENTLY DEPLOYED TO SHIELDS."
2570 GOTO 1990
2590 FOR I=1 TO K3!IF K(I,3)=0 THEN 2700
2610 A$="---"!Z1=K(I,1)!Z2=K(I,2)!GOSUB 8670!GOSUB 8590
2660 K(I,1)=Z1!K(I,2)=Z2!A$="+K+"!GOSUB 8670
2700 NEXT I!GOSUB 6000!D1=0!D6=W1!IF W1>=1 THEN D6=1
2770 FOR I=1 TO 8!IF D(I)>=0 THEN 2880
2790 D(I)=D(I)+D6!IF D(I)>-.1 AND D(I)<0 THEN D(I)=-.1!IF D(I)>-.1 AND D(I)<0 THEN 2880
2800 IF D(I)<0 THEN 2880
2810 IF D1<>1 THEN D1=1 ! IF D1<>1 THEN PRINT "DAMAGE CONTROL REPORT! ";
2840 PRINT TAB(8);!R1=I!GOSUB 8790!PRINT G2$;" REPAIR COMPLETED."
2880 NEXT I!IF RND(1)>.2 THEN 3070
2910 R1=FNR(1)!IF RND(1)>=.0002 THEN 3000
2930 D(R1)=integ(D(R1)-(RND(1)*5+1))!PRINT "DAMAGE CONTROL REPORT! ";
2960 GOSUB 8790!PRINT G2$;" DAMAGED"!PRINT!GOTO 3070
3000 PRINT "DAMAGE CONTROL REPORT! ";
3030 GOSUB 8790!PRINT G2$;" STATE OF REPAIR IMPROVED"!PRINT
3070 A$="---"!Z1=INTeg(S1)!Z2=INTeg(S2)!GOSUB 8670
3110 X1=C(C1,1)+(C(C1+1,1)-C(C1,1))*(C1-INTeg(C1))!X=S1!Y=S2
3140 X2=C(C1,2)+(C(C1+1,2)-C(C1,2))*(C1-INTeg(C1))!Q4=Q1!Q5=Q2
3170 FOR I=1 TO w1!S1=S1+X1!S2=S2+X2!IF S1<1 OR S1>=9 OR S2<1 OR S2>=9 THEN 3500
3240 S8=INTeg(S1)*24+INTeg(S2)*3!IF MID$(Q$,(S8-26),3)="---"THEN 3360
3320 S1=INTeg(S1-X1)!S2=INTeg(S2-X2)!PRINT "WARP ENGINES SHUT DOWN AT ";
3350 PRINT "SECTOR";S1;CHR$(8);",";S2;"DUE TO BAD NAVAGATION"!GOTO 3370
3360 NEXT I!S1=INTeg(S1)!S2=INTeg(S2)
3370 A$="<E>"!Z1=INTeg(S1)!Z2=INTeg(S2)!GOSUB 8670!GOSUB 3910!T8=1
3430 IF W1<1 THEN T8=.1*INTeg(10*W1)
3450 T=T+T8!IF T>T0+T9 THEN 6220
3480 cls = 0 ! GOTO 1990
3500 IF S1<=0 THEN Q1=Q1-1 ! IF S1>8 THEN Q1=Q1+1
3590 IF S2<=0 THEN Q2=Q2-1 ! IF S2>8 THEN Q2=Q2+1
3620 X5=0!IF Q1<1 THEN X5=1!IF Q1<1 THEN Q1=1
3670 IF Q1>8 THEN X5=1!IF Q1>8 THEN Q1=8
3710 IF Q2<1 THEN X5=1!IF Q2<1 THEN Q2=1
3750 IF Q2>8 THEN X5=1!IF Q2>8 THEN Q2=8
if s1<=0 then s1=8
if s1>8 then s1=1
if s2<=0 then s2=8
if s2>8 then s2=1
X=s1+(((w1-1)-(i-1))*x1)!if x > 8 then x=x-8
y=s2+(((w1-1)-(i-1))*x2)!if y > 8 then y=y-8
S1=X!S2=Y
3790 IF X5=0 THEN 3860
3800 PRINT "LT. UHURA! MESdSAGE FROM STARFLEET COMMAND --"
3810 PRINT " 'PERMISSION TO ATTEMPT CROSSING OF GALACTIC PERIMETER"
3820 PRINT " IS HEREBY *DENIED*. SHUT DOWN YOUR ENGINES.'"
3830 PRINT "CHIEF ENGINEER SCOTT! 'WARP ENGINES SHUT DOWN"
3840 PRINT " AT SECTOR";S1;CHR$(8);",";S2;"OF QUADRANT";Q1;CHR$(8);",";Q2;CHR$(8);".'"
3850 IF T>T0+T9 THEN 6220
3860 IF 8*Q1+Q2=8*Q4+Q5 THEN 3370
3870 T=T+1!GOSUB 3910!GOTO 1320
3910 E=E-N3-10!IF E>=0 THEN RETURN
3930 PRINT "SHIELD CONTROL SUPPLIES ENERGY TO COMPLETE THE MANEUVER."
3940 S=S+E!E=0!IF S<=0 THEN S=0
3980 RETURN
4000 IF D(3)>0 THEN PRINT "LONG RANGE SENSORS ARE INOPERABLE."!IF D(3)>0 THEN GOTO 1990
4030 text clear ! offset=-120 ! PRINT "LONG RANGE SCAN FOR QUADRANT";Q1;CHR$(8);",";Q2!PRINT
4040 O1$="-------------------"!PRINT O1$
4060 FOR I=Q1-1 TO Q1+1!N(1)=-1!N(2)=-2!N(3)=-3!FOR J=Q2-1 TO Q2+1
4120 IF I>0 AND I<9 AND J>0 AND J<9 THEN N(J-Q2+2)=G(I,J)!IF I>0 AND I<9 AND J>0 AND J<9 THEN Z(I,J)=G(I,J)
4180 NEXT J!FOR L=1 TO 3!PRINT "| ";!IF N(L)<0 THEN PRINT "*** ";!IF N(L)<0 THEN GOTO 4230
4210 PRINT RIGHT$(STR$(N(L)+1000),3);" ";
4230 NEXT L!PRINT "|"!PRINT O1$!NEXT I!GOTO 1990
4260 gosub butclr ! IF D(4)>0 THEN PRINT "PHASERS INOPERATIVE."!IF D(4)>0 THEN GOTO 1990
4265 IF K3>0 THEN 4330
4270 PRINT "SCIENCE OFFICER SPOCK! 'SENSORS SHOW NO ENEMY SHIPS"
4280 PRINT " IN THIS QUADRANT'"!GOTO 1990
4330 IF D(8)<0 THEN PRINT "COMPUTER FAILURE HAMPERS ACCURACY."
4350 PRINT "PHASERS LOCKED ON TARGET; ";
4360 PRINT "ENERGY AVAILABLE =";E;"UNITS"
4370 INPUT "NUMBER OF UNITS TO FIRE":X!IF X<=0 THEN 1990
4400 IF E-X<0 THEN 4360
4410 E=E-X!IF D(7)<0 THEN X=X*RND(1)
4450 H1=INTeg(X/K3)!FOR I=1 TO 3!IF K(I,3)<=0 THEN 4670
4480 H=INTeg((H1/SQR((K(I,1)-S1)^2+(K(I,2)-S2)^2))*(RND(1)+2))!IF H>.15*K(I,3)THEN 4530
4500 PRINT "SENSORS SHOW NO DAMAGE TO ENEMY AT";K(I,1);CHR$(8);",";K(I,2);CHR$(8);"."!GOTO 4670
4530 K(I,3)=K(I,3)-H!PRINT H;"UNIT HIT ON KLINGON AT SECTOR";K(I,1);CHR$(8);",";
4550 PRINT K(I,2);CHR$(8);"."!IF K(I,3)<=0 THEN PRINT!IF K(I,3)<=0 THEN PRINT CHR$(22);"*** KLINGON DESTROYED ***";CHR$(22)!IF K(I,3)<=0 THEN GOTO 4580
4560 PRINT " (SENSORS SHOW";K(I,3);"UNITS REMAINING)"!GOTO 4670
4580 K3=K3-1!K9=K9-1!Z1=K(I,1)!Z2=K(I,2)!A$="---"!GOSUB 8670
4650 K(I,3)=0!G(Q1,Q2)=G(Q1,Q2)-100!Z(Q1,Q2)=G(Q1,Q2)!IF K9<=0 THEN 6370
4670 NEXT I!GOSUB 6000!GOTO 1990
4700 gosub butclr ! IF P<=0 THEN PRINT "ALL PHOTON TORPEDOES EXPENDED."!IF P<=0 THEN GOTO 1990
4730 IF D(5)>0 THEN PRINT "PHOTON TUBES ARE NOT OPERATIONAL."!IF D(5)>0 THEN GOTO 1990
4760 gosub course
4780 IF C1>=1 AND C1<9 THEN 4850
4790 PRINT " ENSIGN CHEKOV! 'INCORRECT COURSE DATA, SIR!'"
4800 GOTO 1990
4850 X1=C(C1,1)+(C(C1+1,1)-C(C1,1))*(C1-INTeg(C1))!E=E-2!P=P-1
4860 X2=C(C1,2)+(C(C1+1,2)-C(C1,2))*(C1-INTeg(C1))!X=S1!Y=S2
4910 PRINT "TORPEDO TRACK!"
4920 X=X+X1!Y=Y+X2!X3=X!Y3=Y
4960 IF X3<1 OR X3>8 OR Y3<1 OR Y3>8 THEN 5490
5000 PRINT " ";X3;CHR$(8);",";Y3!offset=offset+20!A$="---"!Z1=X!Z2=Y!GOSUB 8830
5050 IF Z3<>0 THEN 4920
5060 A$="+K+"!Z1=X!Z2=Y!GOSUB 8830!IF Z3=0 THEN 5210
5110 PRINT !PRINT CHR$(22);"*** KLINGON DESTROYED ***";CHR$(22)!PRINT !K3=K3-1!K9=K9-1!offset=offset+20!IF K9<=0 THEN 6370
5150 FOR I=1 TO 3!IF X3=K(I,1)AND Y3=K(I,2)THEN 5190
5180 NEXT I!I=3
5190 K(I,3)=0!GOTO 5430
5210 A$="-*-"!Z1=X!Z2=Y!GOSUB 8830!IF Z3=0 THEN 5280
5260 PRINT "STAR AT";X3;",";Y3;"ABSORBED TORPEDO ENERGY."!GOSUB 6000!offset=offset+20!GOTO 1990
5280 A$=">B<"!Z1=X!Z2=Y!GOSUB 8830!IF Z3=0 THEN 4760
5330 PRINT CHR$(22);"*** STARBASE DESTROYED ***";CHR$(22)!offset=offset+30!B3=B3-1!B9=B9-1
5360 IF B9>0 OR K9>T-T0-T9 THEN 5400
5370 offset=offset+40!PRINT "THAT DOES IT, CAPTAIN!! YOU ARE HEREBY RELIEVED 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!"!D0=0
5430 Z1=X!Z2=Y!A$="---"!GOSUB 8670
5470 G(Q1,Q2)=K3*100+B3*10+S3!Z(Q1,Q2)=G(Q1,Q2)!GOSUB 6000!GOTO 1990
5490 PRINT "TORPEDO MISSED."!PRINT!GOSUB 6000!offset=offset+20!GOTO 1990
5530 gosub butclr ! IF D(7)<0 THEN PRINT "SHIELD CONTROL INOPERABLE."!IF D(7)<0 THEN GOTO 1990
5560 PRINT "ENERGY AVAILABLE =";E+S;!INPUT "NUMBER OF UNITS TO SHIELDS":X
5580 IF X<0 OR S=X THEN PRINT "<SHIELDS UNCHANGED>"!IF X<0 OR S=X THEN GOTO 1990
5590 IF X<=E+S THEN 5630
5600 PRINT "SHIELD CONTROL! 'THIS IS NOT THE FEDERATION TREASURY.'"
5610 PRINT "<SHIELDS UNCHANGED>"!GOTO 1990
5630 E=E+S-X!S=X!PRINT "DEFLECTOR CONTROL ROOM!"
5660 offset=20!PRINT " 'SHIELDS NOW AT";INTeg(S);"UNITS PER YOUR COMMAND.'"!GOTO 1990
5690 IF D(6) <= 0 THEN 5910
5700 PRINT "DAMAGE CONTROL REPORT NOT AVAILABLE."!IF D0=0 THEN 1990
5720 D3=0!FOR I=1 TO 8!IF D(I)<0 THEN D3=D3+.1
5760 NEXT I!IF D3=0 THEN 1990
5780 PRINT!D3=D3+D4!IF D3>=1 THEN D3=.9
5810 PRINT "TECHNICIANS STANDING BY TO EFFECT REPAIRS TO YOUR SHIP;"
5820 PRINT "ESTIMATED TIME TO REPAIR!";.01*INTeg(100*D3);"STARDATES."
5840 INPUT "WILL YOU AUTHORIZE THE REPAIR ORDER (Y/N)":A$
5860 IF A$<>"Y"THEN 1990
5870 FOR I=1 TO 8!IF D(I)<0 THEN D(I)=0
5890 NEXT I!T=T+D3+.1
5910 text clear ! PRINT "DEVICE STATE OF REPAIR"!PRINT "------ ---------------"!FOR R1=1 TO 8
5920 GOSUB 8790!PRINT G2$;LEFT$(Z$,25-LEN(G2$));INTeg(D(R1)*100)*.01
5950 NEXT R1!PRINT!IF D0<>0 THEN 5720
5980 GOTO 1990
6000 IF K3<=0 THEN RETURN
6010 IF D0<>0 THEN PRINT "STARBASE SHIELDS PROTECT THE ENTERPRISE."!IF D0<>0 THEN RETURN
6040 FOR I=1 TO 3!IF K(I,3)<=0 THEN 6200
6060 H=INTeg((K(I,3)/(SQR((K(I,1)-S1)^2+(K(I,2)-S2)^2)))*(2+RND(1)))!S=S-H!K(I,3)=K(I,3)/(3+RND(1))
6080 PRINT!PRINT H;"UNIT HIT ON ENTERPRISE FROM SECTOR";K(I,1);CHR$(8);",";K(I,2);CHR$(8);"."
6090 IF S<=0 THEN 6240
6100 PRINT " <SHIELDS DOWN TO";S;"UNITS>"!IF H<20 THEN 6200
6120 IF RND(1)>.6 OR H/S<=.02 THEN 6200
6140 R1=FNR(1)!D(R1)=integ(D(R1)-H/S-.5*RND(1))!GOSUB 8790
6170 PRINT "DAMAGE CONTROL! '";G2$;" DAMAGED BY THE HIT'"
6200 NEXT I!RETURN
6220 PRINT!PRINT "IT IS STARDATE";T;CHR$(8);"."!PRINT!GOTO 6270
6240 PRINT!PRINT "THE ENTERPRISE HAS BEEN DESTROYED. THE FEDERATION ";
6250 PRINT "WILL BE CONQUERED."!GOTO 6220
6270 gosub butclr ! PRINT "THERE WERE";K9;"KLINGON BATTLE CRUISERS LEFT AT"
6280 PRINT "THE END OF YOUR MISSION."
6290 PRINT!PRINT!IF B9=0 THEN 6360
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'" ! gosub aye ! IF A$ = "AYE" THEN goto 10
6360 print ! PRINT ! PRINT "Stoping Simulation....." ! Stop
6370 PRINT "CONGRATULATIONS, CAPTAIN! THE LAST KLINGON BATTLE CRUISER"
6380 PRINT "MENACING THE FEDERATION HAS BEEN DESTROYED."!PRINT
6400 PRINT "YOUR EFFICIENCY RATING IS";1000*(K7/(T-T0))^2!GOTO 6290
6430 FOR I=(S1-1) TO (S1+1)!FOR J=(S2-1) TO (S2+1)
6450 IF INTeg(I)<1 OR INTeg(I)>8 OR INTeg(J)<1 OR INTeg(J)>8 THEN 6540
6490 A$=">B<"!Z1=I!Z2=(J)!GOSUB 8830!IF Z3=1 THEN 6580
6540 NEXT J!NEXT I!D0=0!GOTO 6650
6580 D0=1!C$="DOCKED"!E=E0!P=P0
6620 PRINT "SHIELDS DROPPED FOR DOCKING PURPOSES."!S=0!GOTO 6720
6650 IF K3>0 THEN C$="*RED*"!IF K3>0 THEN GOTO 6720
6660 C$="GREEN"!IF E<E0*.1 THEN C$="YELLOW"
6720 IF D(2)>=0 THEN 6770
6730 PRINT "*** SHORT RANGE SENSORS ARE OUT ***"!RETURN
6770 O1$=" +--1---2---3---4---5---6---7---8-+"!PRINT O1$!FOR I=1 TO 8!PRINT I;"|";
6820 FOR J=((I-1)*24)+1 TO((I-1)*24)+22 STEP 3!PRINT " ";MID$(Q$,J,3);!NEXT J!PRINT "|";I;
6830 ON I GOTO 6850,6900,6960,7020,7070,7120,7180,7240
6850 PRINT " STARDATE ";!PRINT INTeg(T*10)*.1!GOTO 7260
6900 if c$ ="GREEN" then offset=-30!print " CONDITION "; ! IF C$="*RED*" THEN PRINT CHR$(22);"*RED*";CHR$(22) ! if c$="*RED*" then offset=offset+20!if C$="*RED*" THEN goto 6902 ! IF C$="DOCKED" THEN PRINT CHR$(22);"DOCKED";CHR$(22) ! IF C$="DOCKED" THEN goto 6902 ! print C$
6902 GOTO 7260
6960 PRINT " QUADRANT ";Q1;CHR$(8);",";Q2;CHR$(8)!GOTO 7260
7020 PRINT " SECTOR ";S1;CHR$(8);",";S2;CHR$(8)!GOTO 7260
7070 PRINT " PHOTON TORPEDOES ";!PRINT INTeg(P)!GOTO 7260
7120 PRINT " TOTAL ENERGY ";!PRINT INTeg(E+S)!GOTO 7260
7180 PRINT " SHIELDS ";!PRINT INTeg(S)!GOTO 7260
7240 PRINT " KLINGONS REMAINING";!PRINT INTeg(K9)
7260 NEXT I!PRINT O1$!RETURN
7290 gosub butclr ! text clear ! IF D(8)>0 THEN PRINT "COMPUTER DISABLED."!IF D(8)>0 THEN GOTO 1990
7320 print "COMPUTER ACTIVE AND AWAITING COMMAND" ! print ! goto computer
7350 PRINT!H8=1!ON A+1 GOTO 7540,7900,8070,8500,8150,7400
7360 PRINT "FUNCTIONS AVAILABLE FROM LIBRARY-COMPUTER!"
7365 PRINT "-----------------------------------------"!PRINT
7370 PRINT " 0 = CUMULATIVE GALTIC RECORD"
7372 PRINT " 1 = STATUS REPORT"
7374 PRINT " 2 = PHOTON TORPEDO DATA"
7376 PRINT " 3 = STARBASE NAV DATA"
7378 PRINT " 4 = DIRECTION/DISTANCE CALCULATOR"
7380 PRINT " 5 = GALAXY 'REGION NAME' MAP"!PRINT!GOTO 7320
7400 H8=0!G5=1!PRINT " THE GALAXY"!GOTO 7550
7540 PRINT " ";
7544 PRINT "COMPUTER RECORD OF GALAXY FOR QUADRANT";Q1;CHR$(8);",";Q2
7546
7550 PRINT " 1 2 3 4 5 6 7 8"
7560 O1$=" +-----+-----+-----+-----+-----+-----+-----+-----+"
7570 PRINT O1$!FOR I=1 TO 8!PRINT I;" ";!IF H8=0 THEN 7740
7630 FOR J=1 TO 8!PRINT "| ";!IF Z(I,J)=0 THEN PRINT "??? ";!IF Z(I,J)=0 THEN GOTO 7720
7700 PRINT RIGHT$(STR$(Z(I,J)+1000),3);" ";
7720 IF J=8 THEN PRINT "|"
7721 NEXT J!GOTO 7850
7740 Z4=I!Z5=1!GOSUB 9030!J0=INTeg(15-.5*LEN(G2$))!PRINT TAB(J0);G2$;
7800 Z5=5!GOSUB 9030!J0=INTeg(39-.5*LEN(G2$))!PRINT TAB(J0);G2$
7850 PRINT O1$!NEXT I!PRINT!offset = 100 ! GOTO cmds
7900 PRINT " STATUS REPORT!"!PRINT " -------------"!X$=""!IF K9>1 THEN X$="S"
7940 PRINT K9;"KLINGON";X$;" LEFT."
7960 PRINT " MISSION MUST BE COMPLETED IN";.1*INTeg((T0+T9-T)*10);"STARDATES."
7970 X$="S"!IF B9<2 THEN X$=""!IF B9<1 THEN 8010
7980 PRINT " THE FEDERATION IS MAINTAINING";B9;"STARBASE";X$;" IN THE GALAXY."
7990 GOTO 5690
8010 PRINT "YOUR STUPIDITY HAS LEFT YOU ON YOUR OWN IN"
8020 PRINT " THE GALAXY -- YOU HAVE NO STARBASES LEFT!"!GOTO 5690
8070 IF K3<=0 THEN 4270
8080 X$=""!IF K3>1 THEN X$="S"
8090 PRINT "FROM ENTERPRISE TO KLINGON BATTLE CRUSER";X$
8100 H8=0!FOR I=1 TO 3!IF K(I,3)<=0 THEN 8480
8110 W1=K(I,1)!X=K(I,2)
8120 C1=S1!A=S2!GOTO 8220
8150 PRINT "DIRECTION/DISTANCE CALCULATOR!"
8160 PRINT "YOU ARE AT QUADRANT ";Q1;CHR$(8);",";Q2;" SECTOR ";S1;CHR$(8);",";S2;CHR$(8);"."
8170 INPUT "PLEASE ENTER INITIAL COORDINATES (X,Y)":C1,A
8200 INPUT "FINAL COORDINATES (X,Y)":W1,X
8220 X=X-A!A=C1-W1!IF X<0 THEN 8350
8250 IF A<0 THEN 8410
8260 IF X>0 THEN 8280
8270 IF A=0 THEN C1=5!IF A=0 THEN GOTO 8290
8280 C1=1
8290 IF ABS(A)<=ABS(X)THEN 8330
8310 PRINT "DIRECTION =";C1+(((ABS(A)-ABS(X))+ABS(A))/ABS(A))!GOTO 8460
8330 PRINT "DIRECTION =";C1+(ABS(A)/ABS(X))!GOTO 8460
8350 IF A>0 THEN C1=3!IF A>0 THEN GOTO 8420
8360 IF X<>0 THEN C1=5!IF X<>0 THEN GOTO 8290
8410 C1=7
8420 IF ABS(A)>=ABS(X)THEN 8450
8430 PRINT "DIRECTION =";C1+(((ABS(X)-ABS(A))+ABS(X))/ABS(X))!GOTO 8460
8450 PRINT "DIRECTION =";C1+(ABS(X)/ABS(A))
8460 PRINT "DISTANCE =";integ(SQR(X^2+A^2))!IF H8=1 THEN 1990
8480 NEXT I!GOTO 1990
8500 IF B3<>0 THEN PRINT "FROM ENTERPRISE TO STARBASE!"!W1=B4!X=B5!IF B3<>0 THEN GOTO 8120
8510 PRINT "MR. SPOCK! 'SENSORS SHOW NO STARBASES IN THIS QUADRANT.'";
8520 GOTO 1990
8590 R1=FNR(1)!R2=FNR(1)!if r1>8 or r2>8 then 8590!if r1<1 or r2<1 then 8590!A$="---"!Z1=R1!Z2=R2!GOSUB 8830!IF Z3=0 THEN 8590
8600 RETURN
8670 S8=INTeg(Z2*3)+INTeg(Z1*24)
8675 IF LEN(A$)<>3 THEN PRINT "ERROR"! IF LEN(A$)<>3 THEN print "stoping"!IF LEN(A$)<>3 THEN stop
8680 IF S8=1 THEN Q$=A$&RIGHT$(Q$,190)!if s8 = 1 then RETURN
8690 IF S8=190 THEN Q$=LEFT$(Q$,190)&A$!if s8 = 190 then RETURN
8700 Q$=LEFT$(Q$,S8-26)&A$&RIGHT$(Q$,192-(s8-26))!RETURN
8790 ON R1 GOTO 8792,8794,8796,8798,8800,8802,8804,8806
8792 G2$="WARP ENGINES"!RETURN
8794 G2$="SHORT RANGE SENSORS"!RETURN
8796 G2$="LONG RANGE SENSORS"!RETURN
8798 G2$="PHASER CONTROL"!RETURN
8800 G2$="PHOTON TUBES"!RETURN
8802 G2$="DAMAGE CONTROL"!RETURN
8804 G2$="SHIELD CONTROL"!RETURN
8806 G2$="LIBRARY-COMPUTER"!RETURN
if z1=8 then z1=7!print z1;z2;!print MID$(Q$,S8+1,3);z3
8830 S8=((Z2-1)*3)+((Z1-1)*24)!Z3=0
8891 IF MID$(Q$,S8+1,3) = A$ THEN Z3 = 1 ! IF MID$(Q$,S8+1,3) = A$ THEN RETURN
8900 RETURN
9030 IF Z5<=4 THEN ON Z4 GOTO 9040,9050,9060,9070,9080,9090,9100,9110
9035 GOTO 9120
9040 G2$="ANTARES"!GOTO 9210
9050 G2$="RIGEL"!GOTO 9210
9060 G2$="PROCYON"!GOTO 9210
9070 G2$="VEGA"!GOTO 9210
9080 G2$="CANOPUS"!GOTO 9210
9090 G2$="ALTAIR"!GOTO 9210
9100 G2$="SAGITTARIUS"!GOTO 9210
9110 G2$="POLLUX"!GOTO 9210
9120 ON Z4 GOTO 9130,9140,9150,9160,9170,9180,9190,9200
9130 G2$="SIRIUS"!GOTO 9210
9140 G2$="DENEB"!GOTO 9210
9150 G2$="CAPELLA"!GOTO 9210
9160 G2$="BETELGEUSE"!GOTO 9210
9170 G2$="ALDEBARAN"!GOTO 9210
9180 G2$="REGULUS"!GOTO 9210
9190 G2$="ARCTURUS"!GOTO 9210
9200 G2$="SPICA"
9210 IF G5<>1 THEN ON Z5 GOTO 9230,9240,9250,9260,9230,9240,9250,9260
9220 RETURN
9230 G2$=G2$&" I"!RETURN
9240 G2$=G2$&" II"!RETURN
9250 G2$=G2$&" III"!RETURN
9260 G2$=G2$&" IV"!RETURN
9999 END
trekinst:
text clear
button 0 hide ! button 1 hide
PRINT CHR$(26)
PRINT TAB(10);"*************************************"
PRINT TAB(10);"* *"
PRINT TAB(10);"* *"
PRINT TAB(10);"* * * SUPER STAR TREK * * *"
PRINT TAB(10);"* *"
PRINT TAB(10);"* *"
PRINT TAB(10);"*************************************"
PRINT CHR$(26)
PRINT " INSTRUCTIONS"
PRINT
PRINT "1. WHEN YOU SEE \COMMAND ?\ PRINTED, ENTER ONE OF THE LEGAL"
PRINT " COMMANDS (NAV,SRS,LRS,PHA,TOR,SHE,DAM,COM, OR XXX)."
PRINT "2. IF YOU SHOULD TYPE IN AN ILLEGAL COMMAND, YOU'LL GET A SHORT"
PRINT " LIST OF THE LEGAL COMMANDS PRINTED OUT."
PRINT "3. SOME COMMANDS REQUIRE YOU TO ENTER DATA (FOR EXAMPLE, THE"
PRINT " 'NAV' COMMAND COMES BACK WITH 'COURSE (1-9) ?'.) IF YOU"
PRINT " TYPE IN ILLEGAL DATA (LIKE NEGATIVE NUMBERS), THAT COMMAND"
PRINT " WILL BE ABORTED"
PRINT
PRINT " THE GALAXY IS DIVIDED INTO AN 8 X 8 QUADRANT GRID,"
PRINT "AND EACH QUADRANT IS FURTHER DIVIDED INTO AN 8 X 8 SECTOR GRID."
PRINT
PRINT " YOU WILL BE ASSIGNED A STARTING POINT SOMEWHERE IN THE"
PRINT "GALAXY TO BEGIN A TOUR OF DUTY AS COMMANDER OF THE STARSHIP"
PRINT "\ENTERPRISE\; YOUR MISSION: TO SEEK AND DESTROY THE FLEET OF"
PRINT "KLINGON WARWHIPS WHICH ARE MENACING THE UNITED FEDERATION OF"
PRINT "PLANETS."
PRINT
gosub more
button 2 hide
text clear
PRINT " YOU HAVE THE FOLLOWING COMMANDS AVAILABLE TO YOU AS CAPTAIN"
PRINT "OF THE STARSHIP ENTERPRISE:"
PRINT
PRINT "\NAV\ COMMAND = WARP ENGINE CONTROL --"
PRINT " COURSE IS IN A CIRCULAR NUMERICAL 3"
PRINT " VECTOR ARRANGEMENT AS SHOWN 4 . 2"
PRINT " INTEGER AND REAL VALUES MAY BE ..."
PRINT " USED. (THUS COURSE 1.5 IS HALF- 5---*---1"
PRINT " WAY BETWEEN 1 AND 2 ..."
PRINT " 6 . 8"
PRINT " VALUES MAY APPROACH 9.0, WHICH 7"
PRINT " ITSELF IS EQUIVALENT TO 1.0"
PRINT " COURSE"
PRINT " ONE WARP FACTOR IS THE SIZE OF "
PRINT " ONE QUADTANT. THEREFORE, TO GET"
PRINT " FROM QUADRANT 6,5 TO 5,5, YOU WOULD"
PRINT " USE COURSE 3, WARP FACTOR 1."
PRINT "\SRS\ COMMAND = SHORT RANGE SENSOR SCAN"
PRINT " SHOWS YOU A SCAN OF YOUR PRESENT QUADRANT."
PRINT
PRINT " SYMBOLOGY ON YOUR SENSOR SCREEN IS AS FOLLOWS:"
PRINT " <E> = YOUR STARSHIP'S POSITION"
PRINT " +K+ = KLINGON BATTLE CRUISER"
PRINT " >B< = FEDERATION STARBASE (REFUEL/REPAIR/RE-ARM HERE!)"
PRINT " -*- = STAR"
PRINT
PRINT " A CONDENSED 'STATUS REPORT' WILL ALSO BE PRESENTED."
PRINT
gosub more
button 2 hide
text clear
PRINT "\LRS\ COMMAND = LONG RANGE SENSOR SCAN"
PRINT " SHOWS CONDITIONS IN SPACE FOR ONE QUADRANT ON EACH SIDE"
PRINT " OF THE ENTERPRISE (WHICH IS IN THE MIDDLE OF THE SCAN)"
PRINT " THE SCAN IS CODED IN THE FORM \###\, WHERE TH UNITS DIGIT"
PRINT " IS THE NUMBER OF STARS, THE TENS DIGIT IS THE NUMBER OF"
PRINT " STARBASES, AND THE HUNDRESDS DIGIT IS THE NUMBER OF"
PRINT " KLINGONS."
PRINT
PRINT " EXAMPLE - 207 = 2 KLINGONS, NO STARBASES, & 7 STARS."
PRINT "\PHA\ COMMAND = PHASER CONTROL."
PRINT " ALLOWS YOU TO DESTROY THE KLINGON BATTLE CRUISERS BY "
PRINT " ZAPPING THEM WITH SUITABLY LARGE UNITS OF ENERGY TO"
PRINT " DEPLETE THEIR SHIELD POWER. (REMEMBER, KLINGONS HAVE"
PRINT " PHASERS TOO!)"
PRINT "\TOR\ COMMAND = PHOTON TORPEDO CONTROL"
PRINT " TORPEDO COURSE IS THE SAME AS USED IN WARP ENGINE CONTROL"
PRINT " IF YOU HIT THE KLINGON VESSEL, HE IS DESTROYED AND"
PRINT " CANNOT FIRE BACK AT YOU. IF YOU MISS, YOU ARE SUBJECT TO"
PRINT " HIS PHASER FIRE. IN EITHER CASE, YOU ARE ALSO SUBJECT TO "
PRINT " THE PHASER FIRE OF ALL OTHER KLINGONS IN THE QUADRANT."
PRINT
PRINT " THE LIBRARY-COMPUTER (\COM\ COMMAND) HAS AN OPTION TO "
PRINT " COMPUTE TORPEDO TRAJECTORY FOR YOU (OPTION 2)"
PRINT
gosub more
button 2 hide
text clear
PRINT "\SHD\ COMMAND = SHIELD CONTROL"
PRINT " DEFINES THE NUMBER OF ENERGY UNITS TO BE ASSIGNED TO THE"
PRINT " SHIELDS. ENERGY IS TAKEN FROM TOTAL SHIP'S ENERGY. NOTE"
PRINT " THAT THE STATUS DISPLAY TOTAL ENERGY INCLUDES SHIELD ENERGY"
PRINT "\DAM\ COMMAND = DAMMAGE CONTROL REPORT"
PRINT " GIVES THE STATE OF REPAIR OF ALL DEVICES. WHERE A NEGATIVE"
PRINT " 'STATE OF REPAIR' SHOWS THAT THE DEVICE IS TEMPORARILY"
PRINT " DAMAGED."
PRINT "\COM\ COMMAND = LIBRARY-COMPUTER"
PRINT " THE LIBRARY-COMPUTER CONTAINS SIX OPTIONS:"
PRINT " OPTION 0 = CUMULATIVE GALACTIC RECORD"
PRINT " THIS OPTION SHOWES COMPUTER MEMORY OF THE RESULTS OF ALL"
PRINT " PREVIOUS SHORT AND LONG RANGE SENSOR SCANS"
PRINT " OPTION 1 = STATUS REPORT"
PRINT " THIS OPTION SHOWS THE NUMBER OF KLINGONS, STARDATES,"
PRINT " AND STARBASES REMAINING IN THE GAME."
PRINT " OPTION 2 = PHOTON TORPEDO DATA"
pRINT " WHICH GIVES DIRECTIONS AND DISTANCE FROM THE ENTERPRISE"
PRINT " TO ALL KLINGONS IN YOUR QUADRANT"
PRINT " OPTION 3 = STARBASE NAV DATA"
PRINT " THIS OPTION GIVES DIRECTION AND DISTANCE TO ANY "
PRINT " STARBASE WITHIN YOUR QUADRANT"
PRINT " OPTION 4 = DIRECTION/DISTANCE CALCULATOR"
PRINT " THIS OPTION ALLOWS YOU TO ENTER COORDINATES FOR"
PRINT " DIRECTION/DISTANCE CALCULATIONS"
PRINT " OPTION 5 = GALACTIC /REGION NAME/ MAP"
PRINT " THIS OPTION PRINTS THE NAMES OF THE SIXTEEN MAJOR "
PRINT " GALACTIC REGIONS REFERRED TO IN THE GAME."
gosub more
button 2 hide
text clear
goto 1280
yesno:
button 0 show ! button 1 show
button 0 title "YES" at 10,350 size 45,40
button 1 title "NO" at 60,350 size 45,40
loop1:
if button_pressed("0") then 1310
if button_pressed("1") then goto trekinst
goto loop1
return
more:
button 2 show
button 2 title "MORE" at 10,650 size 55,40
loop2:
if button_pressed("2") then return
goto loop2
cmds:
button 3 show ! button 4 show ! button 5 show ! button 6 show ! button 7 show ! button 8 show ! button 9 show ! button 10 show ! button 11 show
button 3 title "NAV" at 10,(345+offset) size 45,40
button 4 title "SRS" at 60,(345+offset) size 45,40
button 5 title "LRS" at 110,(345+offset) size 45,40
button 6 title "PHA" at 160,(345+offset) size 45,40
button 7 title "TOR" at 210,(345+offset) size 45,40
button 8 title "SHD" at 260,(345+offset) size 45,40
button 9 title "DMG" at 310,(345+offset) size 45,40
button 10 title "COM" at 360,(345+offset) size 45,40
button 11 title "xXx" at 410,(345+offset) size 45,40
offset = 0
loop3:
if button_pressed("3") then 2300
if button_pressed("4") then goto 1979
if button_pressed("5") then goto 4000
if button_pressed("6") then goto 4260
if button_pressed("7") then goto 4700
if button_pressed("8") then goto 5530
if button_pressed("9") then goto 5690
if button_pressed("10") then goto 7290
if button_pressed("11") then goto 6270
goto loop3
course:
button 12 show ! button 13 show ! button 14 show ! button 15 show ! button 16 show ! button 17 show ! button 18 show ! button 19 show ! button 20 show
button 12 title "0" at 80,360 size 45,40
button 13 title "1" at 150,360 size 45,40
button 14 title "2" at 135,315 size 45,40
button 15 title "3" at 80,295 size 45,40
button 16 title "4" at 25,315 size 45,40
button 17 title "5" at 10,360 size 45,40
button 18 title "6" at 25,405 size 45,40
button 19 title "7" at 80,425 size 45,40
button 20 title "8" at 135,405 size 45,40
c1=-1
do
if button_pressed("12") then c1 =.4
if button_pressed("13") then c1 = 1
if button_pressed("14") then c1 = 2
if button_pressed("15") then c1 = 3
if button_pressed("16") then c1 = 4
if button_pressed("17") then c1 = 5
if button_pressed("18") then c1 = 6
if button_pressed("19") then c1 = 7
if button_pressed("20") then c1 = 8
until c1 > 0
button 12 hide ! button 13 hide ! button 14 hide ! button 15 hide ! button 16 hide ! button 17 hide ! button 18 hide ! button 19 hide ! button 20 hide
return
full:
w1=-1
button 21 show ! button 22 show ! button 23 show ! button 24 show ! button 25 show ! button 26 show ! button 27 show ! button 28 show ! button 29 show
button 21 title "0" at 10,300 size 45,40
button 22 title "1" at 60,300 size 45,40
button 23 title "2" at 110,300 size 45,40
button 24 title "3" at 160,300 size 45,40
button 25 title "4" at 210,300 size 45,40
button 26 title "5" at 260,300 size 45,40
button 27 title "6" at 310,300 size 45,40
button 28 title "7" at 360,300 size 45,40
button 29 title "8" at 410,300 size 45,40
do
if button_pressed("21") then w1 = 0
if button_pressed("22") then w1 = 1
if button_pressed("23") then w1 = 2
if button_pressed("24") then w1 = 3
if button_pressed("25") then w1 = 4
if button_pressed("26") then w1 = 5
if button_pressed("27") then w1 = 6
if button_pressed("28") then w1 = 7
if button_pressed("29") then w1 = 8
until w1 > -1
button 21 hide ! button 22 hide ! button 23 hide ! button 24 hide ! button 25 hide ! button 26 hide ! button 27 hide ! button 28 hide ! button 29 hide
return
reduce:
w1=-1
button 30 show ! button 31 show !
button 30 title "0" at 10,300 size 45,40
button 31 title ".25" at 60,300 size 45,40
do
if button_pressed("30") then w1 = 0
if button_pressed("31") then w1 = .25
until w1 > -1
button 30 hide ! button 31 hide
return
computer:
button 32 show ! button 33 show ! button 34 show ! button 35 show ! button 36 show ! button 37 show
PRINT " = CUMULATIVE GALATIC RECORD" ! print
PRINT " = STATUS REPORT" ! print
PRINT " = PHOTON TORPEDO DATA" ! print
PRINT " = STARBASE NAV DATA" ! print
PRINT " = DIRECTION/DISTANCE CALCULATOR" ! print
PRINT " = GALAXY 'REGION NAME' MAP"
button 32 title "" at 10,44 size 45,40
button 33 title "" at 10,89 size 45,40
button 34 title "" at 10,134 size 45,40
button 35 title "" at 10,179 size 45,40
button 36 title "" at 10,224 size 45,40
button 37 title "" at 10,269 size 45,40
A=-1
do
if button_pressed("32") then A = 1
if button_pressed("33") then A = 2
if button_pressed("34") then A = 3
if button_pressed("35") then A = 4
if button_pressed("36") then A = 5
if button_pressed("37") then A = 6
until a > 0
text clear
button 32 hide ! button 33 hide ! button 34 hide ! button 35 hide ! button 36 hide ! button 37 hide
h8 = 1
ON A GOTO 7540,7900,8070,8500,8150,7400
butclr:
button 3 hide ! button 4 hide ! button 5 hide ! button 6 hide ! button 7 hide ! button 8 hide ! button 9 hide ! button 10 hide ! button 11 hide !
return
aye:
a$="1"
button 38 show ! button 39 show
button 38 title "AYE" at 10,650 size 45,40
button 39 title "nay" at 150,650 size 45,40
do
if button_pressed("38") then a$ = "AYE"
if button_pressed("39") then a$ = "nay"
until len(a$) > 2
button 38 hide ! button 39 hide
return