Patterns / Computation / Small experiments
A rule that writes its own road
A tiny reversible walker makes an irregular tangle, then a repeating highway. Try the rules forwards and backwards.
A walker on a grid follows the same tiny rule, over and over. For a while it makes an irregular tangle. Then, without any change of instructions, it starts writing a road.
This is Langton’s ant. In the version here, a white square means “turn left” and a green square means “turn right”. Change the square’s colour, then move forward one place. Begin on a blank grid, facing north. There is no random choice.
Let the ant walk
Start slowly to see each turn, or choose See the highway to jump to 12,000 moves. Then run forwards—or backwards. The small ring marks home; the red arrow is the ant.
Static view at 12,000 moves. Enable JavaScript to run the interactive simulation.
White → left; green → right. Each visit flips the square.
0 · left1 · left2 · right3 · right
The view fits the current picture automatically. Squares beyond it still exist: the grid does not wrap. Animation starts paused, pauses when the page is hidden, and stops at 100,000 moves. Backwards stops at the blank start.
Nothing tells it to build a road
In my blank-start calculation, the later turn sequence repeats every 104 moves. Each cycle shifts the ant two squares east and two south, with the same direction at the end. The early tangle remains behind it. The repeating thing is the travelling pattern, not the entire growing grid.
This is a familiar example, rather than a discovery of mine. Gajardo, Lutfalla, and Rao’s 2024 paper, Ants on the highway, defines these travelling patterns and explores more elaborate rules. Different starting orientations and left/right conventions can rotate or mirror the pictures.
Unmake the journey
The backwards button does not play a recording. It moves one square behind the ant, reads the colour left there, restores that square’s previous colour, and undoes the corresponding turn. The picture, position, and direction together contain enough information to reverse a move.
My separate Python calculation went forward 30,000 moves and then backwards 30,000, recovering the exact blank start. Thirty randomly prepared finite pictures also returned exactly to their starting states after 1,000 moves each way. The browser version uses the same rules; it keeps no list of past turns.
A walker that keeps coming home
Switch the rule to LLRR. Now each square cycles through four states. The first two mean left; the next two mean right. This small alteration gives a very different picture.
In my separate million-move run from a blank grid, it returned to the origin 19,607 times. Meanwhile, the greatest coordinate distance it had reached grew from four squares after 1,000 moves to fifty after a million. The browser offers the first 100,000 moves of that same walk.
Repeated homecomings and a growing reach can coexist. Those finite measurements illustrate the contrast; they do not prove what every initial picture does forever.
What a repeated pattern can establish
A long repeated stretch is evidence about a calculation. To go further for this particular two-colour run, I checked the 43 squares visited during the 104 moves after step 12,000. Their input pattern reappears shifted by (2, −2), with no obstructing coloured squares in its forward path. I also checked that squares left behind cannot enter that path later. Together these finite conditions support repeating the same argument for the next translated cycle.
That establishes a route from this reached pattern. It does not show that every finite starting picture must reach one. The research paper’s highway definition is useful precisely because it separates a travelling seed from the larger question about which beginnings lead to it.
The distinction is what I wanted to keep from this wander: simple instructions, reversible steps, and an eventual regular pattern are three different things to understand.
A question, a correction, or a connection of your own?
I’d be glad to hear it.