The code

Versions of Spacewar!

Spacewar! is not one program but a family of them. Across 1962 and 1963 it was written, patched, and re-patched by a shifting cast of authors, and later reconstructed and extended by preservationists. For a critical code reading this matters: there is no single canonical text, only a variorum, and the differences between versions are themselves evidence of how the game, the machine, and the culture around them changed.

This page summarises the principal versions. Every one of them can be played, in faithful emulation, at Norbert Landsteiner's masswerk.at/spacewar, on whose detailed documentation this summary draws throughout.

VersionDateAuthor(s)StatusMediumCodeKey points
11961 / early 1962Russell, with the Hingham Institute groupLOST[Text]First playable: two ships and torpedoes, no gravity or hyperspace.
2AMar 1962?Russell, Edwards, SamsonLOSTInferred: the March 1962 integration stage before 2B, where gravity (Edwards) came together. No source known.
2B2 Apr 1962Russell, Samson, Graetz, et al.RECOVEREDPaper tape[Text]First complete version, shown at MIT Parents' Weekend. Expensive Planetarium (Samson), Minskytron hyperspace, single-shot torpedoes.
3.124 Sep 1962RussellRECOVEREDPaper tape[Text]The standard version, patches consolidated; the most widely preserved and emulated.
4.02 Feb 1963Preonas ("ddp")RECOVEREDSource listing[Text] [PDF]Base of the whole 4.x family: hardware multiply/divide and floating-point gravity, no score display. Identified and extracted from the Morris scan by the CCS team; the dfw fork branches from it.
Spacewar! 4 · the ddp fork, Monty Preonas (Diamantis Drakos Preonas), later with Joe Morris
4.0TS4 May 1963Preonas ("ddp")RECOVEREDSource listing[Text] [PDF]A "Twin Star" variant of 4.0: simplified starfield (4th-magnitude stars removed) and minor hyperspace changes. Recovered by the CCS team.
4.211 May 1963Preonas ("ddp")RECOVEREDSource listing[Text] [PDF]Restored Expensive Planetarium; the first on-screen score display; complex input parsing via iot 111.
4.317 May 1963Preonas ("ddp")RECOVEREDSource listing[Text] [PDF]4.2 plus a Twin Star subjective view on sense switch 2: the display recentres on the Needle.
4.417 / 21 May 1963Preonas ("ddp") & MorrisRECOVEREDSource listing[Text] [PDF]Dual-console version: alternate frames go to a second scope so each pilot's ship holds the centre. Preonas numbers it 4.3.
Spacewar! 4 · the dfw fork, author unknown ("dfw" is the great Spacewar! mystery)
4.120 Feb 1963"dfw"RECOVEREDListing + tape[Text]The dfw fork, built on Preonas's 4.0: dotted central sun, major code reorganisation. The original 1963 source survives in Steve Russell's tape box, recovered by the CCS team; see 4.1f for the later museum reconstruction.
4.2a~22 Feb 1963"dfw"RECOVEREDListing + tape[Text]Working single-shot mode; "no visible differences to 4.1 dfw." Survives as pt 2 of the original 4.1 listing and as an authentic paper tape (Russell's box).
4.5 / 4.6 / 4.7May–Jul 1963unknownLOSTLost. Three versions between the 4.4 experiment (May) and the stable 4.8 (July); a comment in 4.8 shows one carried dual thrust/velocity controls. No source survives.
4.824 Jul 1963"dfw"RECOVEREDSource listing[Text] [PDF]The last classic MIT version, with the score display reworked by Samson. The identity of "dfw" has never been established.
4.1fbase 20 Feb 1963; mod. 2005–08dfw; reconstructed by SamsonRECOVEREDSource listing[Text]Not a 1963 release but Samson's Computer History Museum reconstruction of dfw 4.1: the 4.8 score display grafted on, star intensities remapped, tweaked to 2008. Now that the original 4.1 survives, the two can be read side by side.

Status reflects what survives: Recovered, a complete program (a paper-tape image or full source); Partial, reassembled from incomplete listings; Lost, no source known. Medium is the form in which it survives: a binary paper tape image (the program as loaded into the PDP-1) or a printed source listing (from which the program is reassembled). Code links the surviving source directly: [Text] a readable listing, [PDF] a scanned original; the per-version detail below gives the full set of files where there is more than one.

Sources: reconstructed listings for several versions at masswerk.at/spacewar/sources (linked per version below); authentic binary paper-tape images at bitsavers.org.

the versions in detail · 1962
The first year
Reels of punched paper tape labelled Spacewar!
Spacewar! distributed on punched paper tape, the medium most of these versions survive in. Computer History Museum, X3602.2006.11.

Spacewar! 1 (1961 to early 1962) LOST

The first playable version, written by Steve Russell and the Hingham Institute group and running by early 1962: two ships, torpedoes, and a simple star background, but no gravity and no hyperspace. The original is lost and survives only through reconstruction. reconstructed source code ›

Spacewar! 2A (March 1962?) LOST

No source survives, so what follows is informed inference. The name implies the version: a letter suffix exists because there is an earlier sibling, and Landsteiner notes that 2B's exhaust flames are half the size of later versions, "hinting at the slower speed of an even earlier version." 2A is best read not as a clean release but as the active integration stage of March 1962, just before the Parents' Weekend showing. Several strands converge here. Dan Edwards's outline compiler, which turned compact ship outlines into efficient display instructions, freed enough processor time to make the next step affordable: the central star and its gravity, also Edwards's work, which turned Russell's inertial duel into a contest of orbits. At the same time Peter Samson was writing the Expensive Planetarium, the accurate starfield whose surviving data is annotated "stars by prs for s/w 2b" and dated 13 March 1962. The earliest documented pre-2B build carries a date of 25 March 1962. On this reading, 2A is the version in which Spacewar! acquired the gravity that made it a game.

Spacewar! 2B (2 April 1962) RECOVERED

The first complete version, and the one shown to the public at MIT Parents' Weekend that month, arguably the first public showing of a digital video game. It carries Peter Samson's Expensive Planetarium (the real star background, devised for this version) and Martin Graetz's hyperspace, whose warp animation borrows the look of Minsky's display hack, the "Minskytron signature". Explosions are blocky, torpedoes single-shot, hyperspace limited to three risky jumps. A curious detail: 2B already assigns each ship a fuel supply, but never actually spends it. This is the version closest to the game's public birth. source code ›

Spacewar! 3.1 (24 September 1962) RECOVERED

The standard version. Returning briefly to MIT, Steve Russell consolidated the scattered patches into one coherent program. It is the version most often preserved and emulated. It is also the first in which fuel is really burned: the rate of consumption is tied to the visual extent of the flickering, random-length exhaust trails, so that thrusting harder both looks and costs more, an instance of what Landsteiner calls the game's "aesthetic realism." source code ›

1963
The 4.x generation

A new line emerged in 1963 that required the PDP-1's hardware multiply/divide option. Monty Preonas (signing "ddp") rewrote the gravity routine using floating-point conversions in version 4.0. From that common base the line split into two forks: Preonas's ddp fork (4.0TS, 4.2, 4.3, 4.4), which added the first on-screen score display and the Twin Star subjective view, and the dfw fork (4.1, 4.2a, 4.8), carried by an author who has never been identified. The masswerk genealogy calls the identity of "dfw" the great Spacewar! mystery.

A boxed reel of Spacewar! paper tape.
Each version was a tape, cut, copied, and re-cut as the game was hacked. Computer History Museum, X3602.2006.19.

Spacewar! 4.0 (2 February 1963) RECOVERED

The base of the 4.x line, by Monty Preonas ("ddp"). It introduced the floating-point gravity routine and the hardware multiply/divide requirement that all later 4.x versions inherit. There is no on-screen score display yet. The source survives as a listing held by Joe Morris and scanned to bitsavers. source listing (PDF) › · normalised text ›

Spacewar! 4.0TS (4 May 1963) RECOVERED

A "Twin Star" variant of 4.0 in Preonas's ddp fork, signed "spacewar 4.0ts 5/4/63 ddp." It is 4.0 with a simplified starfield (the 4th-magnitude star group removed) and a small hyperspace change: a ship re-entering normal space is given a random spin rather than the fixed one of 4.0. It predates the 4.3 Twin Star by nearly two weeks and was recovered by the CCS team. source listing (PDF) › · normalised text ›

Spacewar! 4.1 (20 February 1963) RECOVERED

The base of the "dfw" fork, signed and dated "spacewar 4.1 2/20/63 dfw" and built directly on Preonas's 4.0: a dotted central sun and a major code reorganisation. The original 1963 source survives, recovered by the CCS team from Steve Russell's own box of paper tapes (its second part is the 2/22/63 dfw 4.2a). For years the only accessible 4.1 was Samson's later museum reconstruction (see 4.1f); the original now lets the two be read side by side. original source (txt) ›

Spacewar! 4.1f (20 February 1963; mod. 2005 to 2008) RECOVERED

The version the Computer History Museum's restored PDP-1 plays for visitors, and so, for many people, the face of Spacewar! itself. It repays a close look, because it is not a historical release but a 2005 assemblage: a 4.1 base of 20 February 1963 with the 4.8 score display grafted on and the star intensities remapped to the museum's own machine, adjusted again as late as 2008. The canonical public Spacewar! is, in this sense, a reconstruction, and that a museum of computing exhibits a retrofitted composite as the original is itself a fact a critical reading should register. Now that the original 1963 4.1 has resurfaced (above), the reconstruction can be measured against it directly, which sharpens the point rather than dissolving it. The MACRO source carries Samson's own log at its head: "SW4.1f/spacewar 4.1 mod for CHM, 2005-06-01 to 2005-11-28 ... changed delay in score display, 2008-08-22." Its earlier June 2005 checkpoint survives too, as revision "d". source code (rev. f) › · paper-tape image › · earlier rev. d ›

Spacewar! 4.2a (22 February 1963) RECOVERED

The "dfw" fork's single-shot version, with a slightly fainter, dotted central sun and, per the genealogy, "no visible differences to 4.1 dfw." Its number collides with Preonas's unrelated ddp 4.2: "dfw" used "4.2" here on 22 February 1963, nearly three months before the ddp 4.2 of 11 May, and the two are different programs from the two forks, this one a single-shot revision of 4.1 dfw with no score display. Its source survives as the second part of the original 4.1 listing (the 2/22/63 dfw pt 2) and as an authentic paper tape in Steve Russell's box, both recovered by the CCS team. original source (txt) ›

Spacewar! 4.2 (11 May 1963) RECOVERED

Monty Preonas's own 4.2, which shares only its number with the dfw fork's earlier "4.2" (the 22 February 4.2a above). They are separate programs: where the dfw version is a single-shot revision of 4.1 with no scoring, this ddp 4.2 of 11 May restores the Expensive Planetarium and carries the first on-screen score display, drawn using the outlines of the two ships, and a starfield reminiscent of 2B. The score routine is about two and a half pages long and signed by no one. The source survives as a listing held by Joe Morris, signed "spacewar 4.2 5/11/63 ddp"; its symbol table was assembled by Morris himself ("jcm") on 23 May 1963. source listing (PDF) › · normalised text ›

Spacewar! 4.3 (17 May 1963) RECOVERED

By Monty Preonas ("ddp"), notable for its Twin Star mode, a subjective view rendered from the Needle's perspective and reached on sense switch 2: an early experiment in point-of-view rendering. The original ddp listing survives in the Morris scan. Reading it against the masswerk reconstruction is itself instructive: the reconstruction is a later modified variant that swapped some 1963 code for 4.0-style code, whereas the scanned original keeps the period code, including the active score-display encoder. reconstructed source, masswerk › · original listing, Morris scan (PDF) › · normalised text ›

Spacewar! 4.4 (21 May 1963) RECOVERED

The fullest of the subjective-view experiments, and the richest single find on this page. In Monty Preonas's own later account, a second oscilloscope compatible with the PDP-1 was in the lab for three or four months. At first it served only as a second console, so two players with separate hand controls no longer crowded one screen. Preonas then rebuilt the display to give each cockpit its own view: every other frame was sent to the opposing console, so that on each screen that pilot's ship, the "thin" Needle or the "fat" Wedge, held the centre while the rest of the universe moved around it. By his account it "worked very well," a fully playable game, with one cosmetic flaw: the alternating frames produced a doubled, "twin" star at the centre, never corrected before the borrowed scope was taken away. By giving two players distinct real-time perspectives at once, it predates any other known example of the form by roughly ten years. The listing is signed "ddp," its two parts dated 17 and 21 May 1963, and appears to have been edited by Joe Morris alongside Preonas. A numbering knot remains: Preonas calls this version 4.3, while the reconstruction reserves 4.3 for the simpler single-screen ego view and files this as 4.4. Preonas later donated his annotated listing to the New Mexico Museum of Natural History and Science in Albuquerque. reconstructed source, masswerk › · original listing, Morris scan (PDF) › · normalised text ›

"Version 4.3 was developed when for about a period of 3 or 4 months a new oscilloscope compatible with the PDP-1 was available in the computer lab. At first, we used this scope as the second pilot's console so combatants weren't bumping into each other even though they had separate hand-held consoles. Then I decided to start Version 4.3 to provide a pilot's view from each cockpit. This was accomplished by having every other frame go to the opposing console so that both the 'thin' and 'fat' pilot's ships were stationary in the center of the frame. It worked very well, except we wound up with a double 'twin' star because of the every other frame issue. We ran out of time and had too much fun learning how to play this more difficult version to correct the twin-star problem before we no longer had access to the oscilloscope. As a minor issue, I don't remember who first started keeping score (it was probably me); but I do remember coding a larger ship for every five wins. D.D. "Monty" Preonas, recalling the version he numbered 4.3 (the reconstruction files it as 4.4).

Spacewar! 4.5 (May to July 1963) LOST

Lost, together with 4.6 and 4.7. The three sit in the gap between the 4.4 experiment of late May and the stable 4.8 of 24 July 1963, and no source survives for any of them. What can be said about them has to be reasoned backwards from the versions on either side.

Spacewar! 4.6 (May to July 1963) LOST

Lost. A comment left in the 4.8 source shows that one of these three versions offered dual thrust, or velocity, controls. Which of the three it was cannot now be said.

Spacewar! 4.7 (May to July 1963) LOST

Lost. Since 4.4 left its twin-star fault uncorrected and 4.8 runs clean, it is plausible that one of these missing versions was the issue-free iteration in between. Plausible, but unprovable: the tapes were cut up and thrown out, and the gap in the record is itself part of what the version history records.

Spacewar! 4.8 (24 July 1963) RECOVERED

Apparently the last MIT version, signed "dfw." It carries the on-screen score display in its final form, the Preonas score routine as reworked by Peter Samson. The initials "dfw" have never been identified: in a 2005 exchange neither Steve Russell nor Joe Morris, both present in the lab, could put a name to them. The most polished version of the founding video game is signed by a hand the founders themselves could not place. source code, part 1 › · part 2 › · scorer display ›
Scanned listings: part 1 (PDF) › · part 2 (PDF) › · scorer (PDF) ›

reconstructions
Later and reconstructed

Variants, hacks, and kin

Landsteiner's emulator also carries reconstructions and extensions worth noting for the reading. A Holloman Air Force Base variant restores altered starting positions recorded by a player in 1966. Spacewar! 2015 is Landsteiner's own new PDP-1 program, reviving the Minskytron hyperspace signature and a working subjective view. Parameter hacks such as "Winds of Space" warp the torpedoes' trajectories by tuning a single constant in memory. And the same emulator runs other early PDP-1 graphics programs, including the Minskytron itself and Snowflake.

the long journey · beyond the PDP-1
Ports and clones

Spacewar! leaves the PDP-1

Spacewar! did not stay on one machine. Through the 1960s and into the 1970s it was carried, re-coded, and reinvented on computers across dozens of labs, often rebuilt from memory or a magazine listing rather than the MIT source. That long journey, the full survey of ports and clones from Michigan and Cambridge to Minnesota, Stanford, Georgia Tech and the GT40, now has its own page.

The ports: the long journey beyond the PDP-1 →

See also the deep dives into the PDP-1 itself, the machine the game was written for, and the restorations that keep it runnable, hardware repairs, FPGA rebuilds and faithful emulation.

a hackable game
Why so many

Built to be changed

The proliferation of versions is itself a finding. Every version but the earliest opens with a block of "interesting and often changed constants," arguably the first cheats in gaming, meant to be retuned at the console or in the debugger. The spaceship outlines are likewise defined as hackable strings of octal directives, compiled at run time by Dan Edwards's outline compiler, plausibly the earliest just-in-time compiler. The code was made to be modified, which is part of why the family is so large, and part of what the reading will pursue.

By the 1970s the code had begun to record its own history. The MIT-AI PDP-10 SPCWAR source opens with the eight names the program passed through, WAR → SWAR → SUPER → STAR → SPACE → SPACE4 → NSPACE → SPCWAR, followed by a dated modification log and the note that, on 9 April 1976, new nine-bit control consoles were wired into the PDP-6. The program documents its own variorum: the version history is not only reconstructed by us from outside, it is partly written into the comments by the hackers who kept it running.

Version histories, dates, and technical detail summarised here are drawn from Norbert Landsteiner's masswerk.at/spacewar, where each version can be played and is documented far more fully than this overview.

cheats and hacks
Modifying the game

Cheats and hacks

If the family is large because the code was built to be changed, the changes themselves are worth cataloguing. Some are cheats in the original sense, parameters the program exposes so a player or programmer can retune the rules. Others are hacks, features bolted on by whoever had a better idea. Together they record how the game, the machine, and the people around it actually worked.

The changeable constants

Every version from 4.0 onward opens with a block headed "interesting and often changed constants": torpedo count and velocity, reload time and torpedo life, fuel supply, the gravitational constant, the ration of hyperspace jumps, and more. The listing notes that "all instructions are executed, and may be replaced by jda or jsp", so the block is not inert data but live code, meant to be retuned at the console test word or patched in the DDT debugger. These are, arguably, the first cheats in gaming: the rules made adjustable by design, in the lineage that runs from Steve Russell's original.

Hyperspace, the panic button

Written by Martin Graetz for version 2B, hyperspace flings a cornered ship to a random point and back. Technically it is the game's random-number routine driving a scaled displacement, with the constants hr1 and hr2 setting how far you jump and how hard you arrive, a strict ration of jumps (mhs), and a rising chance of materialising inside an explosion as the "hyperfield generator" recharges (hd1, hd2, hd3). The warp is drawn with the "Minskytron signature", the smear pattern of Marvin Minsky's display hack, a hardware quirk reused as an effect. Escape is never free.

Photon torpedoes: a cheat made of a hardware limit

When Dan Edwards added the central star's gravity, there were no PDP-1 cycles left to make gravity act on the torpedoes as well. Rather than slow the game, the team simply declared them photon torpedoes, immune to gravity by fiat. The gravity routine runs on ships only; the limit became a rule of the fiction. It is the cleanest case on the page of a hardware constraint folded straight into the design.

Reading the boxes

The hand controllers built by Bob Saunders and Alan Kotok in 1962 were themselves a hack of the software: by Saunders's account the boxes were wired and then a single instruction was changed so the program read them, over the iot lines, instead of the console sense switches. The control-word routine still carries both paths, a normal "iot 11" read and a fallback that takes control from the front-panel test word.

Sense switches and the test word

The PDP-1's console sense switches are wired straight into the logic as runtime toggles. The code branches on them with the szs (skip on sense switch) instruction: switch 2 selects a lighter central star, others turn the background stars on or off or, in the ddp line, switch on the subjective view. The front-panel test word, meanwhile, can be read directly for control or for tuning. On this machine the switches are part of the game's interface.

The subjective view

The boldest rendering hack is Monty Preonas's Twin Star, first in 4.0TS and developed through 4.3 and 4.4. Technically the display is recentred on a chosen ship: a relocate routine subtracts that ship's coordinates from everything drawn, so the Needle holds the centre while the universe moves around it. In 4.4, alternate frames are sent to a second oscilloscope, giving each pilot their own cockpit view, point-of-view rendering roughly a decade before the form is usually dated.

Keeping score

Preonas added the first on-screen score display in 4.2, drawn by compiling small digit outlines through a routine over two pages long, with a pulsing separator line. Peter Samson reworked it into its final form for 4.8. The scorer reads the controllers a second time to encode the digits, a neat reuse of the input path.

Later hacks

The game kept being retuned long after MIT. A. W. Kuhfeld's Minnesota CDC-3100 version replaced hyperspace with invisibility: the panic button suppresses your ship's display without moving it, so you vanish, but so does your own view, and your exhaust and torpedoes still give you away, skill in place of luck. Parameter hacks such as "Winds of Space" warp the torpedoes by tuning a single constant in memory; the Holloman Air Force Base variant preserves a player's altered starting positions from 1966. And the PDP-10 versions went furthest: Ralph Gorin's Stanford SAIL Space War carries a routine (GETNAM) to change named parameters at runtime, the constants block grown into a live console for editing the rules.

The artefact

Play version 3.1

This site runs the standard 1962 version, the one read here, in a PDP-1 emulator in your browser.

▶ Play The object