About
The original Star Trek is a 1971-72 text-based game created by high-school student Mike Mayfield, who wrote it for a Sigma 7 computer before porting it to HP BASIC; it entered the public domain and was subsequently rewritten for countless BASIC-based computers. This is a C# port of the classic Star Trek text game, based on a later community BASIC rewrite of Mike Mayfield's original code. The repository keeps the unmodified BASIC source alongside multiple C# versions: a line-by-line translation that preserves the original's line numbers and structure, a cleaned-up version that still resembles the BASIC original, and an object-oriented console rewrite.
How it differs from the original
Unlike the line-numbered BASIC original — where GOTO/GOSUB jumps map directly to line labels and arrays are 1-indexed — the C# ports replace subroutines with methods, pad arrays by one slot to keep 1-based indexing working, and restructure a GOTO that originally jumped into the middle of a FOR loop so the code would compile in C#.
Getting started
It's played entirely through numbered text commands, with the goal of hunting down and destroying a set number of Klingon ships within a limited number of stardates. A short-range scan shows the current 8x8 sector, a long-range scan reveals Klingon ships, starbases, and stars in surrounding quadrants, and starbases can be visited to resupply energy, torpedoes, and repairs.
History
The author wrote this C# port after researching the game's history and Mike Mayfield's original HP BASIC source, starting with a near-literal line-by-line translation before writing cleaner, more idiomatic versions.
Additional notes
- Trivia
- In the original BASIC, the "#" symbol is used as a not-equal-to operator, which the porting author noted resembles the mathematical ≠ symbol.
- Limitation
- Several planned components remain unfinished per the project's own TODO list, including a Windows Forms UI and a Universal Windows app version.