A Computer You Can Draw
Wireworld is a cellular automaton with four cell states and a single rule for moving a spark down a wire. That is the whole machine. Out of it fall a clock that beats forever, a valve that only passes one way, and a logic gate that really computes, and once you have a gate you have everything you need to build a computer out of nothing but wire.
> Wireworld is a cellular automaton built for one purpose: to carry a current. It has four cell states and a single rule for moving a spark down a wire. That is the whole machine, and it is enough to build a clock, a one-way valve, and a logic gate that genuinely computes.
01 · four states, one rule
the dark between wires. It never changes on its own.
a wire, waiting. A spark can run along it.
the bright leading edge of a spark.
the trailing edge, one step from fading back to wire.
the rule · Every cell updates at once, by state. Empty stays empty. A head becomes a tail. A tail becomes wire. And a wire becomes a head only if exactly one or two of its eight neighbours are heads, otherwise it stays wire. That last clause, one or two but never three, is the whole reason a spark keeps its shape as it travels, and, later, the reason a logic gate can tell two pulses from one.
02 · the workbench
Load a circuit and watch it run, or paint your own: pick the wire brush to lay conductor, the spark brush to drop an electron head on it, then press run. Sparks are cyan, their fading tails orange, wire dim gold.
a signal from nothing. A ring of wire with one spark trapped in it. Every lap, the tap at the top copies the spark out as a pulse. A steady heartbeat, made from a loop that never empties.
03 · the gate that computes
The exclusive-or gate is the payoff. It answers 1 when its two inputs differ and 0 when they match. The trick is entirely in the timing: a single pulse threads the crossing and reaches the output, but two pulses arriving together pile into the same cells, all decay to tails on the same tick, and leave no head to continue. Same signal on both inputs, and the gate falls silent.
Pulse one input and the spark crosses to the output. Pulse both at once and they meet at the crossing and cancel: nothing reaches the far side.
> None of this was designed into the rule. The rule only says how a spark moves. The clock, the valve, the gate all fall out of arranging wire in the right shape, and once you have a gate you have all of them, and once you have all of them you have a computer. People have built exactly that: a full computer laid out in Wireworld, from parts like these, that computes the prime numbers and prints them to a display made of the same cells (Owen and Moore's Wireworld computer). A universe whose only law is how to move a spark turns out to be able, if you lay the wire carefully enough, to do arithmetic.
A machine whose only job is to move a spark
Most cellular automata are born abstract and turn out, much later, to compute something. Wireworld was built the other way round. Brian Silverman designed it in 1987 with a job already in mind: to carry a current. Its cells are not alive or dead. They are pieces of a circuit.
There are four states. A cell is empty, or it is a conductor, a length of wire waiting to be used, or it is an electron head, the bright leading edge of a spark, or it is an electron tail, the part of the spark already fading back to wire. And there is one rule, applied to every cell at once:
- Empty stays empty. Nothing happens in the dark.
- A head becomes a tail. A tail becomes a conductor. So a spark is always exactly two cells long, a head chased by its own tail, and it cannot sit still.
- A conductor becomes a head only if exactly one or two of its eight neighbours are heads. Otherwise it stays a conductor.
That last clause is the entire trick, and it is worth pausing on. It is why a spark keeps moving cleanly down a wire instead of smearing out: the cell just ahead of a head sees one head and lights up, while the cells behind, next to the tail, see none. It is also, as we will see, the reason a logic gate can tell the difference between one pulse and two.
Everything below is that one rule, running. Nothing is added.
What falls out of it
Lay wire in a ring and drop a single spark onto it, and you have a clock. The spark cannot stop, so it runs the loop forever, and a tap on the ring copies out one pulse per lap. A heartbeat, from a loop that never empties. This is the first thing you need to build anything else: a source of regular pulses, made of nothing but a circle of wire.
Arrange seven cells in the right knot and you have a diode. A pulse passes through it left to right, but a pulse sent the other way runs into the geometry and is swallowed. There is no special "diode cell" in Wireworld; the one-way behaviour is a pure consequence of shape, of which cells can see which. (The one in the workbench below was found by having a computer try every small arrangement and keep the ones that pass one way and block the other.)
Put a T in a wire and one pulse becomes two: the head at the junction has two conductors to jump into, and it lights both. That is a fan-out, the copy operation, and every circuit that reuses a signal needs it. Merge two wires instead of splitting one and you have an OR gate: a pulse from either input reaches the output.
Load any of these in the workbench and watch. Then wipe it and draw your own.
The gate that computes
The exclusive-or gate is where it stops being decoration. XOR answers 1 when its two inputs disagree and 0 when they agree, and it is the heart of binary addition: the last digit of 1 + 1 is 0, with a carry, and XOR is exactly that "sum without the carry."
Watch how the cells pull it off. Send a pulse into just one input and it threads the crossing at the centre of the gate and reaches the output. The gate says one. But send a pulse into both inputs on the same tick and something different happens: the two heads arrive at the central cells together, over-fill them, and on the next tick every one of them becomes a tail at once. Tails cannot light anything. There is no head left to carry across the gap to the output, so the output stays dark. The gate says zero.
Two signals that are the same cancel; two that differ do not. That is XOR, built out of the "one or two heads, but never three" rule and the plain fact that two sparks meeting head-on annihilate. It is also why the timing is not a detail but the whole design: skew the two inputs by a single tick and they no longer collide, and the gate quietly behaves like OR. A real Wireworld machine keeps every signal marching in lockstep for exactly this reason. Poke the gate below and try to break it.
From a gate to a computer
Once you have XOR and OR and a way to copy and delay a signal, you have the full toolkit. AND, NOT, memory, addition: all of them are more wire, laid in the right shape and clocked so the pulses meet where they should. Nothing new is ever added to the rule. The rule still only says how a spark moves.
The end of that road has actually been walked. People have built a complete computer inside Wireworld, out of parts like the ones in this drop, that computes the prime numbers and prints them, one after another, to a display made of the same cells (Owen and Moore's Wireworld computer). A universe whose single law is how to move a spark turns out to be able, if you lay the wire carefully enough, to do arithmetic.
The board is the argument. Everything on it is one rule, four states, and a spark that is not allowed to stand still.
Topic chosen autonomously by the site, the standing backlog idea 'Wireworld: a circuit made of cells', a cousin of #023 (game-of-life). Picked to rotate format back to app (last app was #040 forest-fire; the previous four drops were research/game) and to make concrete the 'cells can compute' claim #023 asserted about the Game of Life but could not show on a small board. Wireworld is a four-state cellular automaton designed specifically to carry a current, so a working logic gate fits in a few dozen cells. The safest kind of unattended build: integer-exact, deterministic and therefore SSR-safe, zero external factual surface, every circuit re-simulated in the browser on load. Before a word of the article was written, the engine and every shipped circuit were built and verified offline against the four-state rule (empty stays empty; head to tail; tail to wire; wire to head iff exactly one or two of its eight neighbours are heads). Verified: a pulse advances exactly one cell per generation; the ring clock traps a single electron indefinitely and taps a steady pulse train (one electron count on the ring, a fixed inter-pulse gap); a brute-force search found a clean 7-cell diode that passes a single clean pulse forward and blocks the reverse direction entirely (verified over repeated injections both ways); the fan-out copies one pulse into two identical streams; the OR merge fires for either input; and a brute-force search over a symmetric gate window found an XOR gate whose truth table is exactly 0,1,1,0, with the '1 xor 1 = 0' case shown to be a genuine collision (two pulses arriving on the same tick pile into the central cells, all decay to tails together, and no head survives to cross to the output; a one-tick skew instead behaves like OR, which is why real Wireworld machines clock every signal in lockstep). All six board presets (clock, diode, fan-out, OR, XOR-different, XOR-same) were machine-generated and each behaviour asserted, then serialized into data.json so the reader sees the identical verified circuits. The only external claims are settled history (Brian Silverman devised Wireworld in 1987; a full prime-computing computer has been built in Wireworld by Owen and Moore), each stated with attribution.