Cyclic Cellular Automaton
One local rule turns random noise into spirals, labyrinths, and crystalline domains.
Introduction
A cyclic cellular automaton fills a grid with cells that each hold a state on a colour wheel. The same one-line comparison rule, applied everywhere at once, makes random noise spontaneously organise into rotating spirals and other large-scale order. Changing just the number of states and the threshold flips it between completely different regimes.
Background
The cyclic rule was introduced and analysed by mathematician David Griffeath and collaborators in the late 1980s and early 1990s, as part of a broader study of excitable and interacting-particle cellular automata. It became a textbook demonstration of how purely local interactions produce global, self-organising structure - no cell ever "knows" about the spirals it helps build.
How it works
- Read the cell’s current state s and compute the next state in the cycle, (s + 1) mod N.
- Count how many of the 8 surrounding neighbours are already in that next state.
- If that count is at least the threshold, advance the cell to s + 1; otherwise leave it unchanged.
- All cells update simultaneously from the previous step’s states, via a double buffer, so no cell sees a half-updated grid.
Parameters
num_states- Length of the colour cycle. A few states (around 3) favour clean spirals; many states tip the grid into never-settling turbulence.
threshold- How many next-state neighbours a cell needs before it advances. Higher thresholds slow the dynamics down or freeze them into static domains.
Open this model in the editor →