The Minskytron and the circle algorithm
Before Spacewar! there was the Minskytron. Written around 1961–62 by Marvin Minsky for the PDP-1, and properly titled TRI-POS (Three-Position Display), it drew hypnotic, weaving patterns on the same Type 30 tube the game would use, "geometric displays, Lissajous-like figures, and fireworks". It is not Spacewar!, but it is its close kin: the demonstration hack that proved the PDP-1's display could be made to dance, and the source of a small piece of mathematics that ended up inside the game itself.
Watch it draw
Minsky's circle algorithm, plotted in your browser. The green afterglow stands in for the Type 30's long-persistence P7 phosphor.
The figure above is generated by the very algorithm Minsky stumbled on, running live. Nothing here computes a sine, a cosine, or a square root; it is pure integer arithmetic, the only kind the PDP-1 could afford to do thousands of times a second. The slow wobble that makes the ring precess and weave is a second copy of the same algorithm modulating the first.
The difference equation
Minsky's discovery was that you can draw a near-perfect circle without trigonometry. Take a point (x, y) and step it like this:
xnew = x − ε × y
ynew = y + ε × xnew
The trick is in the second line: it uses the just-computed xnew, not the old x. A naive integrator (using the old x) spirals outward and never closes; Minsky's version, by feeding the new value straight back, cancels almost all of the accumulated error and traces a stable, closed loop, very slightly elliptical and very slowly precessing. On the PDP-1 the multiplication by the small constant ε was done not as a multiply but as an arithmetic right-shift, so ε was always 1/2n:
The full Minskytron chains three such oscillators together, each one nudged by the coordinates of the next, which is what produces the weaving, three-lobed "fireworks" rather than a single ring. Minsky reportedly found the whole effect by accident while trying to do something else, and the program had, in the words of the hackers, almost no "play value", which is part of what spurred the move to a real game.
The Minskytron signature
When Martin Graetz added hyperspace to Spacewar! 2B, the warp-out effect, the smear of light a ship leaves as it jumps, was drawn using Minsky's display trick. Players and historians call it the "Minskytron signature": a small, deliberate quotation of Minsky's hack embedded in the game, a piece of one program living on inside another. For a critical reading of the code it is a neat case of computational intertextuality, the game citing its own ancestry in the way it draws.
References
- Norbert Landsteiner, "The Minskytron" (masswerk.at, 2023), for the history, the TRI-POS source, and the circle algorithm reconstructed here, and his running emulation.
- The "Minskytron signature" in Spacewar! hyperspace, after the genealogy at masswerk.at/spacewar.
- Steven Levy, Hackers: Heroes of the Computer Revolution, on Minsky, the hack, and its lack of "play value".