--- title: "Super Trek" id: 64788 type: "computer_media" slug: "super-trek" url: "http://localhost/computer_media/super-trek/" markdown_url: "http://localhost/computer_media/super-trek.md" published_at: "2026-03-08T01:17:26+00:00" modified_at: "2026-03-30T21:45:52+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2026/03/supertrek.png" excerpt: "A port of the 1970s mainframe Super Star Trek, adding Romulan warships, UDG sprites for all objects, and AY chip sound effects to the classic eight-command gameplay." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" genre: - name: "Game" slug: "game" taxonomy: "genre" url: "http://localhost/type/game/" media_type: "Program" download_url: "https://archive.org/download/timex-sinclair-software-archive/Supertrek_Improved%28198x%29%28UNK%29%28TS2068%29%28US%29%28Programs%29.zip" mediadate: "198x" images: - url: "http://localhost/wp-content/uploads/2026/03/supertrek.png" media_type_tags: "Game" --- A Sinclair BASIC port of *Super Star Trek*, extending the classic 1970s mainframe game with Romulan warships as a second enemy type alongside Klingons. The 8×8 galaxy is represented using the standard quadrant/sector grid, with all objects — the Enterprise, Klingons, Romulans, starbases, and stars — rendered as three-character-wide UDG sprites. The game supports the full original command set (NAV, SRS, LRS, PHA, TOR, SHE, DAM, COM, XXX) plus a PLOT/DRAW title screen and AY chip sound effects via the `SOUND` statement. A significant bug in the quadrant-entry routine at line 380 causes both Klingon and Romulan counts to be decoded as the combined enemy total, which can over-spawn enemies in contested sectors. ### **Program structure** | Lines | Section | | --- | --- | | 3430–3790 | Initialization: screen setup, UDG definitions, variable init | | 10–300 | Galaxy generation and mission briefing | | 310–560 | Quadrant entry logic | | 570–740 | Main command loop (`movs = 570`) | | 750–1330 | NAV — navigation/warp drive | | 1340–1420 | LRS — long range sensors | | 1430–1610 | PHA — phasers | | 1620–1920 | TOR — photon torpedoes | | 1930–2000 | SHE — shields | | 2010–2160 | DAM — damage control | | 2170–2270 | Klingon attack subroutine | | 2280–2430 | End game (win/lose) | | 2440–2620 | SRS — short range sensor scan / status display | | 2630–3240 | COM — library computer (5 sub-functions) | | 3250–3420 | Utility subroutines (random placement, quadrant string r/w, names, sound) | #### **UDG sprites** Six groups of UDGs are defined by POKEing into `USR` offsets starting at lines 3580–3600: - `\b\c\d` — starbase (3-char wide sprite) - `\e\f\g` — the Enterprise - `\k\l\m` — Klingon warship - `\n` — star - `\r\s\t` — Romulan warship The quadrant display is stored in the string `q$` (192 characters: 8 rows × 8 sectors × 3 chars each). Subroutines at 3270 and 3320 write to and read from this string to place and detect objects. #### **Constants idiom** - `SGN PI` evaluates to `1` and `NOT PI` evaluates to `0`. These are used pervasively throughout in place of literal `1` and `0`, which is a notable Sinclair BASIC space-saving technique. - **`a8 = 8`** is similarly used as a constant for 8 (the galaxy/quadrant dimension), appearing in array dimensions, loop bounds, and `POKE USR` offsets. - **`movs = 570`** stores the main command loop line number as a variable, used in `GO TO movs` — a common idiom to create a named return point without a subroutine. #### **AY sound** Line 3420 programs the AY chip registers directly (`SOUND 6,6;7,7;8,16;...`) for an explosion/combat sound effect, called on hits and destructions. #### **Title screen** Lines 3470–3510 use `PLOT` and `DRAW` with coordinate data in `DATA` statements to draw a graphic, plus two `CIRCLE` calls (presumably planetary bodies). #### **Galaxy encoding** Each quadrant cell is stored as a 3-digit-ish number: `(klingons + romulans) × 100 + starbases × 10 + stars`. Decoding at line 380 extracts these fields. ## Source Code ``` 10 REM Highly modified & improved SUPER STARTREK 20 GO SUB 3440 30 DEF FN d(d)=SQR (((k(i,SGN PI)-s1)*(k(i,SGN PI)-s1))+((k(i,2)-s2)*(k(i,2)-s2))) 40 DEF FN w(w)=INT (RND*7.98+1.01) 50 LET q1=FN w(SGN PI): LET q2=FN w(SGN PI): LET s1=FN w(SGN PI): LET s2=FN w(SGN PI) 60 FOR i=SGN PI TO 9: LET c(i,SGN PI)=NOT PI: LET c(i,2)=NOT PI: NEXT i 70 LET c(3,SGN PI)=-1: LET c(2,SGN PI)=-1: LET c(4,SGN PI)=-1: LET c(4,2)=-1: LET c(5,2)=-1: LET c(6,2)=-1 80 LET c(1,2)=SGN PI: LET c(2,2)=SGN PI: LET c(6,SGN PI)=SGN PI: LET c(7,SGN PI)=SGN PI: LET c(a8,SGN PI)=SGN PI: LET c(a8,2)=SGN PI: LET c(9,2)=1 90 LET a$="navsrslrsphatorshedamcomxxx" 100 REM position everything inthe galaxy 110 FOR i=SGN PI TO a8: LET d(i)=NOT PI: FOR j=SGN PI TO a8: LET z(i,j)=NOT PI: LET r1=INT (RND*100): LET r2=INT (RND*10+.3): LET b3=NOT PI: LET k3=b3: LET r3=b3 120 IF r1>50 AND r2>0 AND r2<4 AND k9<15 THEN LET k3=r2: LET k9=k9+r2: GO TO 140 130 IF r1<50 AND r2>1 AND r2<4 AND k3<3 AND r9<15 THEN LET r3=r2: LET r9=r9+r2: GO TO 140 140 IF r1>19 AND r1<90 AND (r2=0 OR r2=3 OR r2=7) AND b9<7 THEN LET b3=SGN PI: LET b9=b9+1 150 LET g(i,j)=(k3+r3)*100+b3*10+FN w(SGN PI): NEXT j: NEXT i: IF t9<(k9+r9) THEN LET t9=k9+r9+3 160 REM set up 1 star base & 1Klingon 170 IF b9 THEN GO TO 200 180 IF g(q1,q2)<200 THEN LET g(q1,q2)=g(q1,q2)+100: LET k9=k9+1 190 LET b9=SGN PI: LET g(q1,q2)=g(q1,q2)+10: LET q1=FN w(SGN PI): LET q2=FN w(SGN PI) 200 REM display the assignment 210 CLS : BEEP .07,17: PRINT TAB 10;"ATTENTION!": PRINT ': LET kk=0 220 LET k7=k9: LET r7=r9: IF b9<>1 THEN LET x$="s": LET y$=" are " 230 PRINT "Your orders are as follows:"''"Destroy the ";k9;" Klingon warships" 240 PRINT "and the ";r9;" Romulan warships": PRINT "which have invaded Confederation" 250 PRINT "space before they can attack","Federation headquarters on star","date ";t0+t9;".": PRINT : PRINT "This gives you ";t9;" days." 260 PRINT '"There";y$;b9;" starbase";x$;" in the" 270 PRINT "galaxy for resupplying your"'"spacecraft." 280 PRINT #1;"Press any key to accept command" 290 PAUSE NOT PI: CLS 300 REM start first play, onlydone once 310 LET z4=q1: LET z5=q2: LET k3=NOT PI: LET b3=k3: LET s3=k3: LET g5=k3: LET d4=.5*RND: LET z(q1,q2)=g(q1,q2) 320 IF q1<1 OR q1>a8 OR q2<1 OR q2>a8 THEN GO TO 440 330 GO SUB 3360: IF t0=t THEN PRINT "Your mission begins with your starship located in the galacticquadrant ";g$;".": GO TO 380 360 REM logic for start of gamecycle 370 PRINT "Now entering ";g$'" quadrant" 380 PRINT : LET k3=INT (g(q1,q2)*.01): LET r3=INT (g(q1,q2)*.01): LET b3=INT (g(q1,q2)*.1)-10*k3 390 LET s3=g(q1,q2)-100*k3-10*b3: IF k3=0 AND r3=0 THEN GO TO 430 400 FOR w=SGN PI TO 5: BEEP .5,5: BEEP .2,20: PAUSE 15: NEXT w 410 PRINT "Combat area "; PAPER 2; INK 7;"CONDITION RED": IF s>200 THEN GO TO 430 420 PRINT " Shields dangerously low!!!" 430 FOR i=SGN PI TO PI: LET k(i,SGN PI)=NOT PI: LET k(i,2)=NOT PI: NEXT i 440 FOR i=SGN PI TO 4: LET k(i,PI)=NOT PI: NEXT i: LET q$=z$+z$+z$+z$+z$+z$+z$+z$ 450 LET a$="\e\f\g": LET z1=s1: LET z2=s2: GO SUB 3270: IF k3<1 AND r3<1 THEN GO TO 520 460 IF k3<1 THEN GO TO 490 470 FOR i=SGN PI TO k3: GO SUB 3250: LET a$="\k\l\m": LET z1=r1: LET z2=r2 480 GO SUB 3270: LET k(i,SGN PI)=r1: LET k(i,2)=r2: LET k(i,PI)=s9*(.5+RND): NEXT i 490 IF r3<1 THEN GO TO 520 500 FOR i=SGN PI TO r3: GO SUB 3250: LET a$="\r\s\t": LET z1=r1: LET z2=r2 510 GO SUB 3270: LET r(i,SGN PI)=r1: LET r(i,2)=r2: LET r(i,PI)=s9*(.5+RND): NEXT i 520 IF b3<1 THEN GO TO 540 530 GO SUB 3250: LET a$="\b\c\d": LET z1=r1: LET b4=r1: LET z2=r2: LET b5=r2: GO SUB 3270 540 FOR i=SGN PI TO s3: GO SUB 3250: LET a$=" \n ": LET z1=r1: LET z2=r2: GO SUB 3270: NEXT i 550 REM srs=i=2 560 GO SUB 2440 565 REM movs 570 IF s+e>10 THEN IF e>10 OR d(7)=0 THEN GO TO 610 580 PRINT '"**Fatal error ** You've just stranded your ship in space. you" 590 PRINT "have insufficient maneuvering energy, and shield control is" 600 PRINT "incapable of crosscircuiting to engine room!": GO TO 2290 610 INPUT "Command? "; LINE l$: CLS 620 RESTORE 630: FOR i=SGN PI TO 9: READ c$,i1: IF l$=c$ THEN GO TO i1: NEXT i 630 DATA "nav",750,"srs",550,"lrs",1340,"pha",1430,"tor",1620,"she",1930,"dam",2010,"com",2630,"xxx",2320 640 PRINT '"Enter one of the following:" 650 PRINT "NAV (to set course)" 660 PRINT "SRS (short range sensor scan)" 670 PRINT "LRS (long range sensor scan)" 680 PRINT "PHA (to fire phasers)" 690 PRINT "TOR (to fire torpedoes)" 700 PRINT "SHE (raise or lower shields)" 710 PRINT "DAM (damage control reports)" 720 PRINT "COM (call on library-computer)" 730 PRINT "XXX (to resign your command)" 740 GO TO movs 750 REM nav=i=1 760 PRINT " 4 3 2"'" . . ."'" ..."'"5 ---*--- 1"'" ..."'" . . ."'" 6 7 8"'"Navigation course" 770 INPUT "Course (0-9)? ";c1: IF c1=9 THEN LET c1=1 780 IF c1<1 OR c1>9 THEN PRINT "Lt. Sulu reports: ""Incorrect"'"course data, Sir!""": GO TO movs 790 LET x$="8": IF d(SGN PI).2 THEN GO TO 840 810 IF w1>0 AND w1<=8 THEN GO TO 850 820 IF NOT w1 THEN GO TO movs 830 PRINT "Chief engineer Scott reports: 'The engines won't take warp ";w1: GO TO movs 840 PRINT "Warp engines are damaged.","Maximum speed= warp .2": GO TO movs 850 LET n=INT (w1*8+.5): IF e-n>=0 THEN GO TO 890 860 PRINT "Engineering reports: "'"'Insufficient energy available for maneuvering at warp ";w1;"!" 870 IF s=1 THEN LET d6=1 930 FOR i=SGN PI TO 8: IF d(i)>=0 THEN GO TO 980 940 LET d(i)=d(i)+d6: IF d(i)>-.1 AND d(i)1 THEN LET d1=SGN PI: PRINT "Damage control report:" 970 LET r1=i: GO SUB 3310: PRINT g$;" repair completed." 980 NEXT i: IF RND>.2 THEN GO TO 1040 990 LET r1=FN w(SGN PI): IF RND>=.6 THEN GO TO 1020 1000 LET d(r1)=d(r1)-(RND*5+1): PRINT "Damage control report:" 1010 GO SUB 3310: PRINT g$;" damaged": GO TO 1040 1020 LET d(r1)=d(r1)+RND*3+SGN PI: PRINT "Damage control report:" 1030 GO SUB 3310: PRINT g$'"state of repair improved" 1040 LET a$=" ": LET z1=INT (s1): LET z2=INT (s2): GO SUB 3270 1050 LET x1=c(c1,SGN PI)+(c(c1+1,SGN PI)-c(c1,SGN PI))*(c1-INT (c1)): LET x=s1: LET y=s2 1060 LET x2=c(c1,2)+(c(c1+1,2)-c(c1,2))*(c1-INT (c1)): LET q4=q1: LET q5=q2 1070 FOR i=SGN PI TO n: LET s1=s1+x1: LET s2=s2+x2: IF s1<1 OR s1>=9 OR s2<1 OR s2>=9 THEN GO TO 1160 1080 LET s8=INT (s1)*24+INT (s2)*3-26: IF q$(s8 TO s8+2)=" " THEN GO TO 1110 1090 LET s1=INT (s1-x1): LET s2=INT (s2-x2): PRINT "Warp engines shut down at sector" 1100 PRINT s2;",";s1;" due to bad navigation": GO TO 1120 1110 NEXT i: LET s1=INT (s1): LET s2=INT (s2) 1120 LET a$="\e\f\g": LET z1=INT (s1): LET z2=INT (s2): GO SUB 3270: GO SUB 1300: LET t8=1 1130 IF w1<1 THEN LET t8=.1*INT (10*w1) 1140 LET t=t+t8: IF t>t0+t9 THEN GO TO 2290 1150 GO TO 560 1160 LET x=a8*q1+x+n*x1: LET y=a8*q2+y+n*x2: LET q1=INT (x/a8): LET q2=INT (y/a8): LET s1=INT (x-q1*a8) 1170 LET s2=INT (y-q2*a8): IF s1=0 THEN LET q1=q1-1: LET s1=a8 1180 IF NOT s2 THEN LET q2=q2-1: LET s2=a8 1190 LET x5=NOT PI: IF q1<1 THEN LET x5=SGN PI: LET q1=x5: LET s1=x5 1200 IF q1>a8 THEN LET x5=SGN PI: LET q1=a8: LET s1=q1 1210 IF q2<1 THEN LET x5=SGN PI: LET q2=SGN PI: LET s2=q2 1220 IF q2>a8 THEN LET x5=SGN PI: LET q2=a8: LET s2=q2 1230 IF NOT x5 THEN GO TO 1280 1240 PRINT "Lt. Uhura reports message from Starfleet Command:"'"'Permission to attempt crossing " 1250 PRINT "of galactic perimeter is hereby *DENIED*. Shut down your engines" 1260 PRINT "Chief engineer Scott reports: Warp engines shut down at sector";s1;",";s2;" of quadrant ";q1;",";q2;"." 1270 IF t>t0+t9 THEN GO TO 2290 1280 IF a8*q1+q2=a8*q4+q5 THEN GO TO 1120 1290 LET t=t+SGN PI: GO SUB 1300: GO TO 310 1300 LET e=e-n-10: IF e>=0 THEN RETURN 1310 PRINT "Shield control supplies energy to complete the maneuver." 1320 LET s=s+e: LET e=NOT PI: IF s<=e THEN LET s=e 1330 RETURN 1340 REM lrs=i=3 1350 IF d(PI)0 AND i<9 AND j>0 AND j<9 THEN LET n(j-q2+2)=g(i,j): LET z(i,j)=g(i,j) 1400 NEXT j: FOR l=SGN PI TO PI: PRINT "██";: IF n(l).15*k(i,PI) THEN GO TO 1550 1540 PRINT "Sensors show no damage to enemy at ";k(i,SGN PI);",";k(i,2): GO TO 1610 1550 GO SUB 3420 1560 LET k(i,PI)=k(i,PI)-h: PRINT h;" unit hit on klingon at "'"sector ";k(i,SGN PI);",";k(i,2) 1570 IF k(i,PI)<=NOT PI THEN PRINT "*** Klingon Destroyed ***": GO TO 1590 1580 PRINT "(Sensors show ";k(i,PI);" units"'"remaining)": GO TO 1610 1590 LET kk=kk+SGN PI: LET k3=k3-1: LET k9=k9-1: LET z1=k(i,SGN PI): LET z2=k(i,2): LET a$=" ": GO SUB 3270 1600 LET k(i,PI)=NOT PI: LET g(q1,q2)=g(q1,q2)-100: LET z(q1,q2)=g(q1,q2): IF k9<=NOT PI THEN GO TO 2410 1610 NEXT i: GO SUB 2170: GO TO movs 1620 REM tor=i=5 1630 IF p<=NOT PI THEN PRINT "All photon torpedoes expended": GO TO movs 1640 IF d(5)=1 AND c1<9 THEN GO TO 1680 1670 PRINT "Ensign Chekov reports:"'"""Incorrect course data, Sir!""": GO TO movs 1680 LET x1=c(c1,SGN PI)+(c(c1+1,SGN PI)-c(c1,SGN PI))*(c1-INT (c1)): LET e=e-2: LET p=p-1 1690 LET x2=c(c1,2)+(c(c1+1,2)-c(c1,2))*(c1-INT (c1)): LET x=s1: LET y=s2 1700 PRINT "Torpedo track:" 1710 LET x=x+x1: LET y=y+x2: LET x3=INT (x+.5): LET y3=INT (y+.5) 1720 IF x3<1 OR x3>8 OR y3<1 OR y3>8 THEN GO TO 1920 1730 BEEP x3/100,y3: PRINT TAB 15;x3;",";y3: LET a$=" ": LET z1=x: LET z2=y: GO SUB 3320 1740 IF z3 THEN GO TO 1710 1750 LET a$="\k\l\m": LET z1=x: LET z2=y: GO SUB 3320: IF NOT z3 THEN GO TO 1800 1760 GO SUB 3420: PRINT "** Klingon destroyed **": LET k3=k3-1: LET k9=k9-1: LET kk=kk+SGN PI: IF k9<=NOT PI THEN GO TO 2410 1770 FOR i=SGN PI TO PI: IF x3=k(i,SGN PI) AND y3=k(i,2) THEN GO TO 1790 1780 NEXT i: LET i=3 1790 LET k(i,PI)=NOT PI: GO TO 1900 1800 LET a$=" \n ": LET z1=x: LET z2=y: GO SUB 3320: IF NOT z3 THEN GO TO 1820 1810 PRINT "Star at ";x3;",";y3;" absorbed "'"torpedo energy.": GO SUB 2170: GO TO movs 1820 LET a$="\b\c\d": LET z1=x: LET z2=y: GO SUB 3320: IF NOT z3 THEN GO TO 1650 1830 GO SUB 3420: GO SUB 3420: PRINT "*** STARBASE DESTROYED***": LET b3=b3-1: LET b9=b9-1: LET t9=t9-3: PRINT "*** KLINGON CONQUEST ADVANCES BY THREE DAYS ***" 1840 IF b9>0 OR k9>t-t0-t9 THEN GO TO 1880 1850 PRINT "That does it, Captain!! You are hereby relieved of command and" 1860 PRINT "sentenced to 99 stardates at hard labor on Cygnus 12!!" 1870 GO TO 2330 1880 PRINT "Starfleet Command reviewing yourrecord to consider court martial" 1890 LET d0=0 1900 LET z1=x: LET z2=y: LET a$=" ": GO SUB 3270 1910 LET g(q1,q2)=k3*100+b3*10+s3: LET z(q1,q2)=g(q1,q2): GO SUB 2170: GO TO movs 1920 PRINT "Torpedo missed!": GO SUB 2170: GO TO movs 1930 REM she=i=6 1940 IF d(7)": GO TO movs 1970 IF x<=e+s THEN GO TO 2000 1980 PRINT "Shield control reports:"'"This is not the Federation"'"treasury!!!'" 1990 PRINT ">Shields unchanged>": GO TO movs 2000 LET e=e+s-x: LET s=x: PRINT "Deflector control room report: Shields now at ";INT s;" units per"'"your command.": GO TO movs 2010 REM dam=i=7 2020 IF d(6)>=0 THEN GO TO 2130 2030 PRINT "Damage control report not avail--able.": IF NOT d0 THEN GO TO movs 2040 LET d3=NOT PI: FOR i=SGN PI TO 8: IF d(i)=1 THEN LET d3=.9 2070 PRINT "Technicians standing by to","effect repairs to your ship." 2080 PRINT "Estimated time to repair: ";.01*INT (100*d3);" stardates." 2090 INPUT "Will you authorize the repair order? (y/n) "; LINE a$ 2100 IF a$<>"y" THEN GO TO movs 2110 FOR i=SGN PI TO 8: IF d(i)0 THEN PRINT "Starbase shields protect the Enterprise.": RETURN 2190 FOR i=SGN PI TO PI: IF k(i,PI)<=NOT PI THEN GO TO 2270 2200 LET h=INT ((k(i,PI)/FN d(SGN PI))*(2+RND)): LET s=s-h: LET k(i,PI)=k(i,PI)/(3+RND) 2210 GO SUB 3420: PRINT h;" unit hit on Enterprise "'"from sector ";k(i,SGN PI);",";k(i,2) 2220 IF s<=NOT PI THEN GO TO 2300 2230 PRINT "": IF h<20 THEN GO TO 2270 2240 IF RND>.6 OR h/s<=.02 THEN GO TO 2270 2250 LET r1=FN w(SGN PI): LET d(r1)=d(r1)-h/s-.5*RND: GO SUB 3310 2260 PRINT "Damage control reports:"'g$;" damaged"'"by the hit." 2270 NEXT i: RETURN 2280 REM end: CLS 2290 PRINT "It is stardate ";t: GO TO 2330 2300 CLS : PRINT "The Enterprise has been destroy--ed. The Federation will be" 2310 PRINT "conquered": GO TO 2290 2320 REM xxx=i=9 2330 PRINT "There were ";k9;" Klingin battle"'"cruisers left at the end of your" 2350 PRINT "mission"''': IF NOT b9 THEN GO TO 2400 2360 PRINT "The Federation is in need of a" 2370 PRINT "new starship commander for a " 2380 PRINT "similar mission -- If there is a"'"a volunteer, let him step" 2390 PRINT "forward and enter 'aye'": INPUT LINE a$: IF a$="aye" THEN GO TO 10 2400 STOP 2410 PRINT "Congratulations, Captain! The"'"last battle cruiser menacing the" 2420 PRINT "the Federation has been destroy--ed.": PRINT 2430 PRINT "Your efficiency rating is ";1000*(k7/(t-t0))^2: GO TO 2350 2440 FOR i=s1-1 TO s1+SGN PI: FOR j=s2-1 TO s2+1 2450 IF INT (i+.5)<1 OR INT (i+.5)>8 OR INT (j+.5)<1 OR INT (j+.5)>8 THEN GO TO 2470 2460 LET a$="\b\c\d": LET z1=i: LET z2=j: GO SUB 3320: IF z3=1 THEN GO TO 2480 2470 NEXT j: NEXT i: LET d0=NOT PI: GO TO 2500 2480 LET d0=SGN PI: LET c$="DOCKED": LET e=e0: LET p=p0 2490 PRINT "Shields dropped for docking","purposes.": LET s=NOT PI: GO TO 2520 2500 IF k3>0 THEN LET c$=CHR$ VAL "16"+CHR$ VAL "9"+CHR$ VAL "17"+CHR$ VAL "2"+" RED ": GO TO 2520 2510 LET c$=CHR$ VAL "16"+CHR$ VAL "9"+CHR$ VAL "17"+CHR$ VAL "4"+" GREEN ": IF e=0 THEN CLS : PRINT ,,: PAPER 0: INK 7: GO TO 2540 2530 PRINT '"**Short range sensors are out **"'': RETURN 2540 LET o$=" ": PRINT TAB 6;o$: FOR i=SGN PI TO 8: LET j=(i-1)*24+SGN PI: PRINT TAB 6;" ";q$(j TO j+23);" ": NEXT i 2550 PRINT TAB 6;o$: PAPER 7: INK NOT PI: PRINT AT 12,NOT PI; 2560 IF kk>3 THEN LET kk=NOT PI: LET t9=t9+3: PRINT "Defeat of KLINGON wave sets"'"KLINGON plan back three days" 2570 PRINT AT 0,1;"STARDATE ";INT (t*10)*.1;AT 0,19;"CODE ";c$;AT 14,0; 2580 PRINT "QUADRANT ";q1;",";q2;TAB 15;"SECTOR ";s1;",";s2 2590 PRINT "PHOTON TORPODOES ";INT (p) 2600 PRINT "TOTAL ENERGY ";INT (e+s);TAB 20;"SHIELDS ";INT (s) 2610 PRINT "KLINGONS REMAINING ";INT (k9) 2620 RETURN 2630 REM com=i=8 2640 IF d(a8)1 THEN LET x$="s" 2920 PRINT "Klingon ";x$;" left: ";k9 2930 PRINT "Mission must be completed in "'.1*INT ((t0+t9-t)*10);" stardates" 2940 LET x$="s": IF b9<2 THEN LET x$="": IF b9<1 THEN PRINT "Your stupidity has left you on your own in the galaxy -- You have no starbases left!": GO TO 2020 2950 PRINT "The Federation is maintaining"'b9;" starbase";x$;" in the galaxy." 2960 GO TO 2020 2970 IF k3<=NOT PI THEN GO TO 1450 2980 LET x$="": IF k3>1 THEN LET x$="s" 2990 PRINT "From Enterprise to Klingon"'"battle cruiser";x$ 3000 LET h8=NOT PI: FOR i=SGN PI TO PI: IF k(i,PI)<=NOT PI THEN GO TO 3220 3010 LET w1=k(i,SGN PI): LET x=k(i,2) 3020 LET c1=s1: LET a=s2: GO TO 3070 3030 PRINT "Direction/distance calculator" 3040 PRINT "You are at quadrant ";q1;",";q2'"Sector ";s1;",";s2 3050 PRINT "Please enter initial coordinates": INPUT "(x,y) ";c1,a 3060 PRINT "Final coordinates ": INPUT "(x,y) ";w1,x 3070 LET x=x-a: LET a=c1-w1: IF x0 THEN GO TO 3110 3100 IF NOT a THEN LET c1=5: GO TO 3120 3110 LET c1=1 3120 IF ABS a<=ABS x THEN GO TO 3140 3130 PRINT "Direction= ";c1+(((ABS (a)-ABS (x))+ABS (a))/ABS (a)): GO TO 3210 3140 PRINT "Direction= ";c1+(ABS (a)/ABS (x)): GO TO 3210 3150 IF a>0 THEN LET c1=3: GO TO 3180 3160 IF x THEN LET c1=5: GO TO 3120 3170 LET c1=7 3180 IF ABS a>=ABS x THEN GO TO 3200 3190 PRINT "Direction= ";c1+(((ABS (x)-ABS (a))+ABS (x))/ABS (x)): GO TO 3210 3200 PRINT "Direction= ";c1+(ABS (x)/ABS (a)): GO TO 3210 3210 PRINT "Distance= ";SQR ((x*x)+(a*a)): IF h8=1 THEN GO TO movs 3220 NEXT i: GO TO movs 3230 IF b3 THEN PRINT "From Enterprise to starbase:": LET w1=b4: LET x=b5: GO TO 3020 3240 PRINT "Mr. Spock reports: 'Sensors showno starbases in this quadrant.'": GO TO movs 3250 LET r1=FN w(SGN PI): LET r2=FN w(SGN PI): LET a$=" ": LET z1=r1: LET z2=r2: GO SUB 3320: IF NOT z3 THEN GO TO 3250 3260 RETURN 3270 LET s8=INT (z2-.5)*3+INT (z1-.5)*24+1 3280 IF LEN a$<>3 THEN PRINT "ERROR": STOP 3290 LET q$=(q$( TO 189)+a$ AND s8=190)+(a$+q$(4 TO ) AND s8=1): RETURN 3300 LET q$=q$(1 TO s8-1)+a$+q$(192-(190-s8)+1 TO ): RETURN 3310 LET g$=("warp engines" AND r1=1)+("short range sensors" AND r1=2)+("long range sensors" AND r1=3)+("phaser control" AND r1=4)+("photon tubes" AND r1=5)+("damage control" AND r1=6)+("shield control" AND r1=7)+("library-computer" AND r1=8): RETURN 3320 LET z1=INT (z1+.5): LET z2=INT (z2+.5): LET s8=(z2-1)*3+(z1-1)*24+SGN PI: LET z3=0 3330 IF q$(s8 TO s8+2)<>a$ THEN RETURN 3340 LET z3=SGN PI: RETURN 3350 STOP 3360 IF z5>4 THEN GO TO 3380 3370 LET g$=("Antares" AND z4=1)+("Rigel" AND z4=2)+("Procyon" AND z4=3)+("Vega" AND z4=4)+("Canopus" AND z4=5)+("Altair" AND z4=6)+("Sagittarius" AND z4=7)+("Pollux" AND z4=8): GO TO 3390 3380 LET G$=("Sirius" AND z4=1)+("Deneb" AND z4=2)+("Capella" AND z4=3)+("Betelgeuse" AND z4=4)+("Aldebaran" AND z4=5)+("Regulus" AND z4=6)+("Arcturus" AND z4=7)+("Spica" AND z4=8) 3390 IF g5=1 THEN RETURN 3400 LET g$=g$+(" I" AND (z5=1 OR z5=5))+(" II" AND (z5=2 OR z5=6))+(" III" AND (z5=3 OR z5=7))+(" IV" AND (z5=4 OR z5=8)) 3410 RETURN 3420 SOUND 6,6;7,7;8,16;9,16;10,16;12,56;13,a8: PAUSE 90: SOUND 8,0;9,0;10,NOT PI: RETURN 3430 REM SCREEN$ setup 3440 BRIGHT NOT PI: BORDER 7: PAPER 7: INK 4: CLS : LET a8=8 3450 PRINT "********************************* * * SUPER STAR TREK * * *********************************": PRINT 3460 INK SGN PI 3470 PLOT 64,48: RESTORE 3470: FOR t=SGN PI TO 33: READ t0,t9: DRAW t0,t9: NEXT t 3480 DATA 40,NOT PI,a8,a8,24,NOT PI,a8,a8,32,NOT PI,12,a8,NOT PI,a8,-26,NOT PI,24,24,54,NOT PI,a8,a8,-106,NOT PI,a8,-8 3490 DATA 18,NOT PI,-24,-24,-58,NOT PI,-16,16,26,NOT PI,a8,a8,-16,NOT PI,-a8,a8,-a8,NOT PI,-a8,a8,-24,NOT PI,-a8,-a8,-a8,NOT PI,-a8,-a8,-16,NOT PI,a8,-a8,46,NOT PI,16,-16,-40,NOT PI,32,-32 3500 INK 4: CIRCLE 52,123,2: CIRCLE 52,123,PI: INK 2 3510 FOR t=60 TO 90 STEP 10: CIRCLE t,67,2: NEXT t 3520 BEEP .7,NOT PI: BEEP .3,20: PRINT AT 20,11; PAPER 0; INK 6; BRIGHT 1;"STANDBY!" 3530 PRINT AT 4,1;"THE USS ENTERPRISE --- NCC-1701" 3540 PRINT AT 17,PI;"MISSION BEING TRANSMITTED";AT 18,7;"BY STAR BASE ALPHA" 3550 REM set game variables 3560 LET z$=" ": LET movs=570 3570 DIM g(a8,a8): DIM c(9,2): DIM k(4,4): DIM r(4,4): DIM n(PI): DIM z(a8,a8): DIM d(a8) 3580 RESTORE 3640: FOR t=NOT PI TO 47: READ s: POKE USR "\b"+t,s: NEXT t 3590 FOR t=NOT PI TO 31: READ s: POKE USR "\k"+t,s: NEXT t 3600 FOR t=NOT PI TO 23: READ s: POKE USR "\r"+t,s: NEXT t 3610 LET t=INT (RND*27+23)*101: LET t0=t: LET t9=33+INT (RND*10): LET d0=NOT PI: LET e=5000: LET e0=e 3620 LET b9=NOT PI: LET k9=b9: LET r9=b9 3630 LET p=10: LET p0=p: LET s9=200: LET s=NOT PI: LET x$="": LET y$=" is " 3640 DATA 63,108,252,252,252,108,61,40 3650 DATA 255,NOT PI,255,137,238,41,239,0 3660 DATA 252,54,63,63,63,54,60,20 3670 DATA 255,127,1,1,15,7,NOT PI,0 3680 DATA PI,31,6,28,254,252,120,0 3690 DATA 192,248,NOT PI,7,4,6,4,7 3700 DATA NOT PI,7,15,6,NOT PI,NOT PI,7,0 3710 DATA 14,63,255,31,63,126,252,24 3720 DATA NOT PI,128,192,137,10,12,10,9 3730 DATA 118,145,149,31,248,169,137,110 3740 DATA 3,7,15,95,127,127,65,64 3750 DATA 248,252,254,255,255,255,240,224 3760 DATA NOT PI,NOT PI,NOT PI,79,201,207,74,73 3770 PRINT #1; PAPER 7; INK 4;"(HIT ENTER)": PAUSE NOT PI: CLS : RETURN 3790 CLEAR : SAVE "supertrek" LINE PI ```