Langton's Ant
Run Langton’s Ant and watch it produce apparent chaos for around ten thousand steps before abruptly building a repeating highway, with multi-colour rule variants.
Last reviewed by the Radiatus Cloud team
Need this done properly for your business?
Radiatus delivers secure cloud, DevOps & compliance engineering.
Two rules, and nobody can explain the highway
An ant on a grid turns right on a white square, turns left on a black one, flips the colour it left, and moves forward. From this the ant produces a symmetric pattern for a few hundred steps, then roughly ten thousand steps of what looks like noise, and then, abruptly and without anything changing, it starts building a diagonal corridor of period 104 and continues forever. Nobody has a proof of why the highway appears. It is observed, reproducible from any starting configuration anyone has tried, and unexplained.
The ant always escapes, and that is a theorem
Cohen and Kong proved that the ant's trajectory is always unbounded: whatever finite pattern of black squares you start with, it never stays in a bounded region forever. That is one of very few things actually proved about the system. Whether it always builds a highway specifically is a separate and open question, and the gap between "provably escapes" and "appears to always build a highway" is where the interest sits.
More colours give a small language of behaviours
Generalising to a rule string, where each colour specifies a turn direction, produces a family. Some rules fill space symmetrically forever, some produce highways of different periods, some make expanding triangular regions, and the behaviour is not predictable from the rule string by any known method. RL is the original; RLR, LLRR and RRLLLRLLLRRR each do something visibly different, and finding out which requires running them.
Related tools
- Data Collection Analysis — Analyze app description to infer data collection.
- Dark Pattern Detector — Scan UX text for manipulative patterns.
- AI Risk Disclosure — Generate disclosure text for AI features.
- Maturity Radar — Generate a radar chart of security maturity.
Frequently Asked Questions
What are the rules?
On a white square turn right, on a black square turn left. Then flip the colour of the square you were on and move forward one cell.
What is the highway?
After around ten thousand chaotic steps the ant begins building a repeating diagonal corridor with a period of 104 moves, and continues indefinitely. Nobody has proved why it happens.
Is anything actually proved about it?
That the trajectory is always unbounded, proved by Cohen and Kong. Whether a highway always forms is a separate and open question.
What do the multi-colour rules mean?
Each character of the rule string gives the turn for one colour: R for right, L for left. The ant cycles a cell through the colours as it visits. Behaviour is not predictable from the string by any known method.
Does the starting pattern matter?
The chaotic phase and the highway appear from every starting configuration anyone has tried, though how long the chaos lasts varies. That universality is part of what makes the highway interesting.
Privacy & Security
Everything runs in your browser; nothing is uploaded.
How to Use
Press play to run the ant and watch the highway emerge.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.