[[caption-width-right:236:A stunning "Full Screen Display" of your quadrant, not available in the original teletype version]]

->I've seen the sources to dozens of ''Star Trek'' computer games that various people have written, and I have to believe it's some kind of law. In all of these games, for many different systems, written in many different computer programming languages, and all written independently of each other, all have one thing in common. The variable used to count the number of remaining Klingons -- the enemy -- that haven't been killed yet, is ''always'' '''K9'''.
->-- Paul Robinson

The first ''Franchise/StarTrek'' computer game [[note]]The original version used teletype for output, so it was a few years before it became a "video game"![[/note]] is a TurnBasedStrategy game written by Mike Mayfield in 1971 on a [[UsefulNotes/MainframesAndMinicomputers Sigma 7 mainframe]], using the BASIC programming language. It became one of the big hits of the early home computer era in the late [[TheSeventies 1970s]] and early [[TheEighties 1980s]].

Klingon warships have invaded Federation space and it's up to the Enterprise to hunt them down. Federation space is divided into a grid of 8 by 8 quadrants, and each quadrant is a grid of 8 by 8 sectors. The Enterprise starts in one quadrant, which may have Klingons in it. If not, use long-range scanners to determine the contents of nearby quadrants. Quadrants may contain Klingon warships, friendly [[SpaceStation starbases]], and/or stars. Once you find the enemy, warp to that quadrant.

Combat is turn-based. You have phasers and photon torpedoes, and the Klingons have phasers. Your phasers automatically target the enemy, but may take several shots to destroy them. Torpedoes will kill an enemy in one shot, but you only carry a limited supply of them and you have to aim them by typing in a shot angle. The ship's computer (usually) includes a calculator to help you set up the shot. You can also maneuver using impulse drive. Meanwhile, the Klingons are shooting at you and moving around, and stars can get in the way of the fighting. The Enterprise takes SubsystemDamage, so a lucky shot can cripple you until repairs are made.

The Enterprise runs on a PowerSource of energy units. Warp drive, shields, and phasers all cost energy. (In some variants, taking a hit to your shields consumes energy.) Dock at a starbase to replenish your energy and torpedoes.

The game ends when all the Klingons are destroyed, or you run out of energy (destroyed by enemy fire or out of warp fuel).

BASIC was a very common programming language in the '70s, so the game was ported to minicomputers, and distributed in books and magazines as a type-in program. Later versions deepened the gameplay with exploration, mining missions, and (in some cases) "real time" play where the Klingons acted once every few seconds instead of once per turn.[[note]]A UsefulNotes/TRS80 adaptation named ''Graphictrek 2000'' even included steerable torpedoes[[/note]] It became one of the most popular games of the pre-PC college minicomputer era. In 1978, it was ported to Microsoft BASIC, the emerging standard for microcomputers. Versions appeared for the UsefulNotes/AppleII, UsefulNotes/TRS80, and UsefulNotes/IBMPersonalComputer, and it was one of the most popular games on those platforms too. Derivatives with graphics and sound started appearing, in particular ''VideoGame/StarRaiders'', and the original faded into history.

!!''Star Trek'' the text game provides examples of:

* AbandonShip: Doubling as VideoGameLives. Some variants of the game allow you to abandon the Enterprise; you're then given command of a weaker ship, the USS Faerie Queene, which you can't abandon.
* CaptainErsatz: Since the ''Franchise/StarTrek'' franchise was copyrighted and trademarked, any company that wants to sell a variant of the game has to [[SerialNumbersFiledOff file all the serial numbers off]]. For example, when Radio Shack wanted to sell the Sol-20 variant "TREK 80" for its UsefulNotes/TRS80 microcomputer, they renamed it "Invasion Force", and had it feature the starship ''U.S.S. Hephaestus'' firing its masers and triton missiles at Jovian warships. Similarly, ''EGA Trek'' went with "Mongols". Sears Telegames exclusive release for Atari 2600 was called ''Stellar Track''. Interstel's ''Star Fleet'' series had the United Galactic Alliance fighting off "Krellans" and "Zaldrons".
* CloakingDevice: ''EGA Trek'' also included Romul... "Vandal" ships with this ability. The Zaldrons of "Star Fleet I" had this ability as well.
* DeathOrGloryAttack: One frequent addition to the game is to equip a superweapon on the player's ship, like the DeathRay from ''EGA Trek''. If it worked, it killed every enemy in a quadrant. When it didn't work, it could do enough damage to destroy or cripple the player's ship, or (in ''EGA Trek'') mutate your crew and have them [[InterfaceScrew draw smiley faces on the interface while ignoring your orders]].
* DeflectorShields: A staple of ''Star Trek'', these serve in-game to absorb most of the damage before it impacts the ship and causes structural and subsystem damage.
* DirtyCoward: In ''EGA Trek'', Mongol scout ships have the ability to flee into neighbouring quadrants if damaged and not destroyed, necessitating pursuit sooner or later for cleanup.
* EliteMooks: In ''EGA Trek'', these come in the form of Mongol Commander battleships, and on higher difficulty levels, the occasional Mongol Base; both are significantly tougher than the average battlecruiser of their faction.
* EnemyDetectingRadar: Long-range scanners. Possibly the UrExample in video games. You could tell how many Klingon warships were in a neighboring quadrant, but not precisely ''where'' they were in the quadrant.
* EvilOnlyHasToWinOnce:
* ExplodingBarrels: The stars will explode if a torpedo is fired into them in some versions, destroying anything in the surrounding sectors. (The game penalizes players for stars destroyed to discourage this.) Some versions also have the risk of stars going supernova, destroying the entire quadrant (and damaging the player's ship as it's thrown out).
* ExplosiveOverclocking: The player's ship usually has a cruising speed of Warp 6, although Warp 8 can be attempted in emergencies at the cost of damage to the warp drive subsystem.
* FlipScreenScrolling: Moving from quadrant to quadrant.
* FreewareGames: It was released into the public domain shortly after it was written.
* GameMod: Since it's a type-in BASIC program, you can change it any way you like.
* GameOver: Possibly video gaming's UrExample:
* IdiosyncraticDifficultyLevels: ''EGA Trek'' has Lieutenant-Commander, Commander, Captain, Commodore and Admiral.
* ImmuneToBullets: Vandal ships in ''EGA Trek'', being cloaked, [[NoSell automatically dodge]] torpedo attacks. The only way to take them out (short of an exploding star) is to fly up to close range and pour a large amount of laser energy into them until they explode.
* InvisibleWall: You'll run into one of these if you try to leave the 8x8 quadrant playfield. In some variants, your engines automatically shut down and you get the message "Sorry, edge of galaxy in that direction." In others, you crash into the energy barrier surrounding the galaxy and get damaged.
* InsistentTerminology: The galactic grid is usually said to be composed of 64 quadrants in a standard game. A quadrant is actually a fourth of something. So it would be more proper to call them sectors, and their divisions subsectors. The ''StarTrek'' universe does properly divide the galaxy into four quadrants, but these games were made decades before that development appeared. It may be an understandable mistake, as the original series was sometimes erroneous and inconsistent in the use of the terms "quadrant" and "sector".
* InterfaceScrew: Damage to the Main Computer results in the loss of data on the long-range sensor map, meaning the player has to fly around to scan it all again or reconstruct the last known tactical situation from their own memory.
* ItsUpToYou:
* NonstandardGameOver: Running out of fuel. Probably the UrExample.
* OneHitKill:
** Photon torpedoes, if they make contact.
** ''EGA Trek'' takes this UpToEleven with Mongol Plasma Bolts, which are capable of taking out the Mongols' hostile starbases.
* PinataEnemy: ''EGA Trek'' sometimes spawns Mongol supply ships, which are weaker than their usual battlecruisers, and if the player batters them merely to the point of surrender (not destruction), they hand over their cargo to the player's ship before vanishing from the map. This could vary from emergency life support supplies to Mongol [[PowerCrystal power crystals]] (i.e. dilithium) and [[OneHitKill plasma bolts]].
* PowerSource: Your energy.
* PressXToDie: You can shoot your own starbases! Another probable UrExample. Depending on the version, torpedoing your own starbase will either destroy it -- thereby making it [[CaptainObvious impossible to refuel there again]] -- or cause the starbase to destroy ''you'' in retaliation.
* RandomlyGeneratedLevels: The number and locations of Klingons, starbases, and stars are random.
* RayGun: Phasers.
* SpaceStation: Friendly ones are encountered frequently, where the player can repair and resupply their ship. ''EGA Trek'' adds hostile Mongol bases that serve as immobile EliteMooks.
* SubsystemDamage: Happens frequently during gameplay, usually as a result of combat, but random breakdowns can still happen and require repair time all the same.
* ThatOneRule: Aiming torpedoes. The makers of the ''Star Trek III.5'' variant of the game actually sold aiming charts, so that you could figure out exactly what bearing to fire your torpedoes at, depending on the sector the Klingon ship was in.
* TurnBasedStrategy: Combat alternates between the player's ship and the enemy factions (Klingon, Mongol, Vandal, etc.).
* TwoDSpace: By virtue of having a strict X,Y coordinate system with no Z-axis.
* UndergroundMonkey:
** ''EGA Trek'' had a variety of {{Palette Swap}}ped "Mongol" ships as EliteMooks.
** ''Supertrek'' has a use of shuttlecraft where you would mine for dilithium crystals on planets. This was an alternative to refueling at a starbase.
** ''Supertrek'' also had Romulans that were more of a nuisance than a threat. If you entered a Romulan quadrant, they'd simply politely ask you to leave. They didn't attack unless you attacked them first. And their attacks were weak.