Seed7 - The extensible programming language
Seed7 FAQ Manual Screenshots Examples Libraries Algorithms Download Links
Screenshots Panic Mandelbr Planets Comanche Calc7 Savehd7 Compiler Dnafight Sudoku Wator Tar7 Sydir7 Ftp7 Castle Tetris Make7 Ftpserv Basic Pairs Shisen Eliza Toutf8 Lander Wiz Startrek Mahjong
Screenshots
Startrek Source Code
 previous   up   next 

Star Trek is a text-based computer game from the 1970s. The player is captain of the federation starship USS Enterprise. At stardate 3421 the federation is invaded by a band of Klingon 'pirates' whose objective is to test the federations defenses. If even one survives the trial period, Klingon headquarters will launch an all-out attack. The games mission is to find and destroy the fleet of Klingon warships.

Gameplay

When the game ist started it offers the possibility to get instructions. Afterwards a new game is set up. The area of the federation is arranged in an 8 by 8 grid of quadrants. Each quadrant is further divided into an 8 by 8 grid of sectors. A sector can contain a Klingon (K), star (*), starbase (B), the Enterprise herself (E) or empty space (.). The number of Klingons, starbases and stars in each quadrant is determined when the game is set up. Their exact position within a quadrant is computed every time the Enterprise enters the quadrant. The Enterprise is moved with the 'warp drive' command. The direction of a move is specified in polar coordinates and the distance is is measured in quadrants. The contents of the 64 sectors in the current quadrant can be obtained with the 'short range sensors' command. A 'long range sensor' command writes the number of Klingons, starbases and stars found in adjacent quadrants. The 'galactic records' command can be used to get long range sensor data of all quadrants visited. The Klingons in the current quadrant can be attacked with phasers or photon torpedos. Phasers cost energy and they do not have to be aimed. Phaser power falls off with distance. The Enterprise is also equipped with a small number of photon torpedos. Photon torpedos are aimed with polar coordinates. Docking at a starbase is done by occupying an adjacent sector. It reprovisions the Enterprise with energy and photon torpedoes, as well as repairing all damages.

History

In 1971 Mike Mayfield was a senior in high school. He used an account on a Sigma 7 computer at University of California, Irvine to teach himself BASIC from a book. The Sigma 7 had a port of Spacewar that ran on a vector graphics terminal. He wanted to make a game like that but only had access to an ASR-33 Teletype non-video terminal. At that time the Star Trek television series was hot and he spent a lot of hours brainstorming with his geek friends what could be done without a video terminal. One idea that did stick was the idea of printing a galactic map and a star map to give you some idea what to shoot at, and having phasers reduce power exponentially, like they would if they shot in all directions.

The program went through dozens and dozens of iterations, mainly over the summer after he graduated. He didn't have any disk space allocation, so he had to punch a paper tape each day when he finished and load it back in again the next day. Working on a 10 character per second terminal forced him to keep the program small. Later that summer he ported the program to an HP 2000C computer. He ended doing a rewrite since the HP BASIC variant was quite different from the BASIC on the Sigma 7 and the program had gotten pretty messy from all the changes. This version of the program was added to HP's public domain library, from where it spread all over.

Instructions from the game

It is stardate 3421 and the federation is being invaded by a band of Klingon 'pirates' whose objective is to test our defenses. If even one survives the trial period, Klingon headquarters will launch an all-out attack. As captain of the federation starship 'Enterprise', your mission is to find and destroy the invaders before the time runs out.

You mission is supported by starbases. Docking at a starbase is done by occupying an adjacent sector. It reprovisions your starship with energy and photon torpedoes, as well as repairing all damages.

Warp engine (command 1 or W)

The warp engine control is used to move the Enterprise. You will be asked to set the course, and the distance (measured in warps) for the move. Each move that you make with the Enterprise from one sector to another, or from one quadrant to another, costs you one stardate. Therefore, a 30-stardate game means you have 30 moves to win in.

Course - A number from 1 to 9 indicating a direction. Starting with a 1 to the right and increasing counterclockwise. To move to the left, use a course of 5. A course of 3.5 is halfway between 3 and 4. A course of 8.75 is three-quarters of the way from 8 to 1.
4   3   2
  \ | /
5 - E - 1
  / | \
6   7   8

Warp - One warp moves you the width of a quadrant. A warp of .5 will move you halfway through a quadrant. Moving diagonally across a quadrant to the next will require 1.414 warps. Warp 3 will move you 3 quadrants providing nothing in your present quadrant blocks your exit. Once you leave the quadrant that you were in, you will enter hyperspace; coming out of hyperspace will place you randomly in the new quadrant. Klingons in a given quadrant will fire at you whenever you leave, enter, or move within the quadrant. Entering a course or warp of zero can be used to return to the command mode.

Short range sensors (command 2 or S)

A short range sensor scan will print out the quadrant you presently occupy showing the content of each of the 64 sectors, as well as other pertinent information.

Each sector can contain a Klingon (K), star (*), starbase (B), the Enterprise herself (E), or empty space (.). Each sector is also numbered; a starbase in sector 3-5 is 3 rows down from the top of the short range scan print-out, and 5 sectors to the right.

Long range sensors (command 3 or L)

The long range sensor scan summarizes the quadrant you are in, and the adjoining ones.

The known galaxy is divided into 64 quadrants arranged like a square checkerboard, 8 on a side. Each quadrant is represented as a 3-digit number. The first (hundreds) digit is the number of Klingons in that quadrant, while the middle (tens) digit is the number of starbases, and the units digit is the number of stars. An entry of 305 means 3 Klingons, no starbases, and 5 stars.

Phasers (command 4 or P)

The portion of the Enterprise's energy that you specify will be divided evenly among the Klingons in the quadrant and fired at them. Surviving Klingons will retaliate. Phaser fire bypasses stars and starbases, but is attenuated by the distance it travels. The arriving energy depletes the shield power of its target. Energy is automatically diverted to the shields as needed, but if you run out of energy you'll get fried.

Photon torpedoes (command 5 or T)

Photon torpedo control will launch a torpedo on a course you specify which will destroy any object in its path. Range is limited to the local quadrant. Expect return fire from surviving Klingons.

Course - A number from 1 to 9 indicating a direction. Starting with a 1 to the right and increasing counterclockwise. To move to the left, use a course of 5. A course of 3.5 is halfway between 3 and 4. A course of 8.75 is three-quarters of the way from 8 to 1.
4   3   2
  \ | /
5 - E - 1
  / | \
6   7   8

Galactic records (command 6 or G)

The galactic records section of the ship's computer responds to this command by printing out a galactic map showing the results of all previous sensor scans.

The known galaxy is divided into 64 quadrants arranged like a square checkerboard, 8 on a side. Each quadrant is represented as a 3-digit number. The first (hundreds) digit is the number of Klingons in that quadrant, while the middle (tens) digit is the number of starbases, and the units digit is the number of stars. An entry of 305 means 3 Klingons, no starbases, and 5 stars.


Starting a game

Destroy a star and a klingon

Long range scan and warp drive

 previous   up   next