Star Trek (BASIC)

The Original 1971 BASIC Programme

Dial 555-1702 to Launch

Introduction

Welcome to Star Trek (BASIC), the classic Star Trek BASIC programme running on the Emulator.ca SLP-BASIC interpreter.

There is something special about seeing the old BASIC shape intact. While 555-1701 offers a modern terminal adaptation of Super Star Trek, this line -- 555-1702 -- runs a BASIC programme through the browser-local SLP-BASIC WebAssembly interpreter: line numbers, GOTO statements, INPUT prompts, and all. When you connect, the interpreter boots in a Web Worker, loads the bundled startrek.bas asset, and executes RUN automatically over a Bell 103 / 300-baud modem path.

The original Super Star Trek was written by Mike Mayfield at Lexington High School in 1971 and later refined for publication in David Ahl's 101 BASIC Computer Games. The version presented here has been adapted for the SLP-BASIC V1.2 interpreter, preserving the original game logic while ensuring compatibility with the emulated environment. The galaxy is still 8x8 quadrants. The Enterprise still starts with 3000 energy and 10 torpedoes. The Klingons still must be destroyed before time runs out.

The key difference from the 555-1701 version is presentation. Here, there are no ANSI colours, no box-drawing characters, no cursor positioning. Output is plain text, rendered line by line, close to the teletype and early home-computer style that made BASIC Star Trek memorable.

This backend uses the SLP-BASIC interpreter compiled to WebAssembly and running in your browser. The BASIC programme is a bundled static asset, loaded into the interpreter's memory after the Worker starts. When you see RUN appear on screen, the interpreter is executing that programme locally; there is no live gameplay server or server-side save state.

Quick Start

  1. Dial the BASIC Trek line: ATDT555-1702
  2. Wait for the programme to load -- the interpreter boots, loads the code, and runs automatically
  3. Read the mission briefing showing your stardate, time limit, and Klingon count
  4. Enter commands at the COMMAND? prompt using the three-letter codes
  5. Type HLP to see the full command list at any time

At 300 baud, output takes time. The Short Range Scan and galaxy displays will scroll at an authentic rate. This is part of the experience -- use the time to plan your next move while the screen fills.

Getting Connected

Dialling 555-1702 connects you to an instance of the SLP-BASIC interpreter. The system performs the following sequence automatically:

  1. BASIC interpreter initialises (WASM module loads)
  2. Star Trek programme is loaded from the bundled static asset
  3. Programme is loaded into interpreter memory
  4. RUN command is issued automatically
  5. The game title screen and mission briefing appear

Connection Settings

Setting Value
Phone Number 555-1702
Baud Rate 300
Terminal VT100 / ANSI (plain text output)
Data Format 8N1

You do not need to type any commands to start the game. The programme begins executing as soon as the BASIC interpreter is ready.

The WebAssembly-based BASIC interpreter may take several seconds to initialise on first connection. If you see a blank screen after connecting, wait a moment for the WASM module to compile and the programme to load.

Gameplay Overview

The BASIC version plays identically to the classic Super Star Trek. You command the USS Enterprise through an 8x8 galaxy, destroying all Klingon warships before the stardate deadline.

Your Resources

Resource Starting Value Replenished By
Energy 3000 Docking at starbase
Shields 0 Transferred from energy (SHE)
Torpedoes 10 Docking at starbase

Galaxy Structure

Victory and Defeat

Your final score is calculated as: (Total Klingons x 1000) / Stardates Used.

When the programme asks PLAY AGAIN (Y/N), answer Y to restart immediately. If you answer N, the interpreter returns to READY. and prints a reminder: type RUN to launch another mission, or use the modem escape sequence (+++, wait for OK, then ATH) to hang up.

The Command Prompt

At each turn, the game displays a status line and waits for input:

-------------------------------------
STARDATE 2254  | ENERGY: 2850  SHIELDS: 200
TORPEDOES: 9   | KLINGONS: 17
-------------------------------------

COMMANDS: NAV SRS LRS PHA TOR SHE
          DAM STA DOC HLP QUI

COMMAND? _

Type the three-letter command code and press ENTER. The programme accepts only the first three characters of your input.

Commands

Navigation (NAV)

Move the Enterprise within or between quadrants.

Warp travel advances the stardate and costs energy proportional to warp^2 x distance.

Short Range Scan (SRS)

Displays the 8x8 sector grid of your current quadrant:

SHORT RANGE SCAN
  0 1 2 3 4 5 6 7
0 . . . . * . . .
1 . . . . . . . .
2 . K . . . . . .
3 . . . E . . . .
4 . . . . . . * .
5 . . . . . . . .
6 . . B . . . . .
7 . . . . * . . .

E=ENTERPRISE  K=KLINGON  B=STARBASE  *=STAR

Long Range Scan (LRS)

Scans the eight quadrants surrounding your current position. Each entry is a three-digit code: Klingons, Starbases, Stars.

Fire Phasers (PHA)

Energy-based weapons that auto-target all Klingons in the quadrant. You specify the energy to expend. Damage is divided among targets and falls off with distance.

Fire Torpedoes (TOR)

Fires a photon torpedo along a specified course (0-359 degrees). Torpedoes destroy Klingons on contact. You have a limited supply.

Adjust Shields (SHE)

Transfers energy between the main supply and shields. Shields absorb incoming Klingon fire. Enter the desired shield level; energy is adjusted accordingly.

Damage Report (DAM)

Lists all ship systems and their repair status. Damaged systems are inoperative until repaired (over time or by docking).

Status Report (STA)

Shows time remaining, Klingons left, and starbases remaining.

Dock at Starbase (DOC)

If the Enterprise is adjacent to a starbase, docking replenishes energy, torpedoes, and repairs all damage.

Help (HLP)

Displays the in-game help screen listing all commands.

Quit (QUI)

Ends the current game. You will be asked to confirm.

Differences from 555-1701

Players familiar with the modern Star Trek at 555-1701 should note these differences in the BASIC version:

Feature 555-1701 (Modern) 555-1702 (BASIC)
Display ANSI colour, box drawing Plain text only
Library Computer 5-function menu Not implemented in BASIC programme
Galactic Record Available via COM Not available
Torpedo Calculator COM > 3 Not available
Navigation Fully implemented Basic implementation
Input Style Line input with history Standard BASIC INPUT
Game Over Play again prompt BASIC INPUT Y/N prompt

The BASIC version is a faithful but simplified rendition. The core gameplay loop -- scan, navigate, fight, dock -- remains identical. What you lose in computer assistance you gain in authenticity.

The BASIC interpreter processes commands character by character. Backspace works, but there is no command history or cursor editing. This is how it really was -- every keystroke counted and typos cost you time.

BASIC Interpreter Notes

Because this game runs on the browser-local BASIC interpreter, a few behaviours are worth noting:

Programme Execution

If the Programme Stops

If execution halts unexpectedly, the interpreter will display READY. This means the BASIC programme has stopped. You can:

Error Messages

BASIC error messages (prefixed with ?) indicate interpreter-level problems:

Error Meaning
?PROGRAM LOAD ERROR Failed to fetch the BASIC programme file
?CONNECTION ERROR Modem connection problem
READY. Programme has ended or halted

Command Reference

NAV - Navigate (course 0-359, warp 0.1-8.0)
SRS - Short Range Scan
LRS - Long Range Scan
PHA - Fire Phasers (specify energy amount)
TOR - Fire Photon Torpedoes (specify course)
SHE - Set Shield Level
DAM - Damage Control Report
STA - Status Report
DOC - Dock at Starbase
HLP - Help Screen
QUI - Quit Game

Quick Reference Card

+=====================================================+
|        STAR TREK (BASIC) QUICK REFERENCE            |
+=====================================================+
|                                                     |
| NAVIGATION                COMBAT                    |
| ──────────────────────   ────────────────────────── |
| NAV  Set course/warp     PHA  Fire phasers          |
| Course: 0-359 degrees    TOR  Fire torpedoes        |
| Warp: 0.1-8.0            SHE  Set shield level      |
|                                                     |
| SENSORS                  STATUS                     |
| ──────────────────────   ────────────────────────── |
| SRS  Short Range Scan    STA  Status report         |
| LRS  Long Range Scan     DAM  Damage report         |
|                          DOC  Dock at starbase      |
| SYSTEM                                              |
| ──────────────────────   MAP SYMBOLS                |
| HLP  Help screen         ────────────────────────── |
| QUI  Quit game           E=Enterprise  K=Klingon   |
|                          B=Starbase    *=Star       |
| ENERGY: 3000 max | TORPEDOES: 10 max               |
| COURSE: 0=North, 90=East, 180=South, 270=West      |
+=====================================================+

Appendix: Troubleshooting

Blank Screen After Connecting

Problem: No output appears after dialling 555-1702.

Solution: The WASM-based BASIC interpreter takes several seconds to compile and initialise. Wait 5-8 seconds. If nothing appears after 10 seconds, disconnect and try again.

"READY." Appears Instead of the Game

Problem: The interpreter shows READY. without running the game.

Solution: Type RUN and press ENTER. The programme may have failed to auto-run. If this does not work, the programme may not have loaded -- disconnect and redial.

Game Freezes at INPUT Prompt

Problem: The game appears to stop responding.

Solution: It is likely waiting for your input. Look for a prompt such as COMMAND?, COURSE?, or ENERGY?. Type your response and press ENTER.

Garbled Output

Problem: Text appears corrupted or misaligned.

Solution: The BASIC programme outputs plain text without cursor positioning. Ensure your terminal is set to at least 80 columns wide. At 300 baud, characters arrive slowly -- wait for the full display before responding.

Want to Restart

Problem: You wish to start a new game without disconnecting.

Solution: When the game ends, answer Y to the "PLAY AGAIN" prompt. Alternatively, if the programme has halted, type RUN at the READY. prompt.

See Also