A brass Turing machine runs busy beavers, including all 47 million steps of BB(5).
A read/write head with a rolling state drum sits over a paper tape. Each step it reads the symbol under its lens, looks up the transition table, stamps a new symbol, slides the tape one cell and turns the drum. The shelf holds the 2, 3, 4 and 5-state busy beaver champions, a binary counter and a palindrome checker. The 5-state champion, proved optimal in 2024, really runs all 47,176,870 steps here, its rate ramping up to hundreds of thousands of steps per frame in a tight typed-array loop until it halts with 4,098 ones. Below, a space-time diagram lays each tape state out as a column with the head's path traced in its state colors; long runs keep at most 1,024 columns by dropping every other one and doubling the sampling interval.
Try it. Pick a machine from the shelf (or press 1 to 6), and click any part of a transition cell to change what it writes, which way it moves or which state comes next. Step with the button, the right arrow or a click on the bench. Space runs or pauses, plus and minus change speed, R resets and X builds a random machine.
Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.
Build an animated Turing machine with JavaScript and the HTML canvas element. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.
Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens (scale by devicePixelRatio), and resizes with the window.
- Represent the machine as data: a tape (an array that can grow in both directions, or a big array starting in the middle), a head position, a current state, and a transition table that maps (state, symbol read) to (symbol to write, move left or right, next state). One next state is HALT.
- Load the 4-state busy beaver: A: 0 to 1RB, 1 to 1LB; B: 0 to 1LA, 1 to 0LC; C: 0 to 1RH (halt), 1 to 1LD; D: 0 to 1RD, 1 to 0RA. On a blank tape it should halt after 107 steps with 13 ones.
- Draw the tape as a horizontal strip of cells across the middle of the screen, with the head as a marker over the current cell showing the state letter. Keep the head centered and scroll the tape under it.
- Step a few times per second with requestAnimationFrame, and show the step count and number of ones. Stop with a clear HALT label.
- Draw the transition table and highlight the rule that just fired.
Once that works, make it beautiful:
- Animate each step in phases: the head stamps the new symbol, then the tape slides smoothly one cell.
- Add a space-time diagram below: one row per step showing the whole tape, with the head's position marked, so its zigzag becomes a picture.
- Style it like a physical machine: a paper tape with sprocket holes, a brass head drawn with gradients, and a state drum that rolls to the next letter.
Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as running the 5-state champion's 47 million steps in a fast loop, clicking the table to edit rules, or a palindrome checker with more symbols.