Demo - Automaton (experimental)
Watch an automaton read a word
This automaton decides whether a binary number is divisible by 3. Its state is the remainder so far: reading a bit doubles the number and adds the bit. It is declared once with fromGraph, then both run and drawn. Type a word and the walk grows as you type; edit it and the playhead stays at the same position. Below, you play the automaton yourself: each answer is a choice, a wrong one takes a detour, and changing an earlier answer cuts off the old future.
start: r0
read nothing = 0, remainder 0
Now you be the automaton
Same word. At each bit, pick the state the automaton moves to. Scrub back to an earlier question and pick differently: everything after it is replayed from your new answer. The link in the address bar holds the word and your answers, so it replays this exact walk.