Cyclic Cellular Automaton

Create the spiral waves of the cyclic cellular automaton, directly in your browser.

This free online cyclic cellular automaton simulator starts from pure random noise and lets a very simple rule organize it: every cell has one of several colors arranged in a cycle, and a cell takes the next color of the cycle when enough of its neighbors already have it. Like rock, paper and scissors, every color eats the previous one and is eaten by the next one.

The result is one of the most beautiful sights of the cellular automata: the noise forms droplets, then small "demons" appear and grow into spiral waves that take over the whole grid. Choose one of the 16 classic rules (313, Perfect spirals, Lava lamp, Amoeba, Stripes...) or set the range, the threshold, the number of colors and the neighborhood yourself.

Pick a palette, change the rule while the animation is running, and download the result as a PNG image or record it as a video. Everything runs directly in your browser: nothing is uploaded to a server.

Examples
The rule
The classic rule of David Griffeath. The noise first forms small droplets, then a few "demons" appear and grow into spirals that take over the whole grid.
The number of neighbors of the next color needed to change color, out of 8 neighbors.
Adds a random number, from 0 to this value, to the threshold of every cell on every generation. It gives the organic look of the rock paper scissors automaton.
Rule: R1/T3/C3/NM
You can change the rule while the animation is running, and the waves react to it immediately.
The grid
Image size: 800 x 600 px
The same seed always generates exactly the same noise.
Click and drag on the grid to add random noise, which creates new waves and brings a frozen grid back to life.
The animation
Generation: 0
Cells that changed color: 0
The colors
Download
Generate and download video
Generation: 0Changed cells: 0Grid: 200 x 150Rule: R1/T3/C3/NM
Click and drag on the grid to add random noise.

How to create a cyclic cellular automaton

  1. Choose a rule - Start with 313, the classic rule of David Griffeath, or pick one of the other presets: Perfect spirals, Lava lamp, Amoeba, Stripes, Rock paper scissors...
  2. Adjust the rule - Change the number of colors, the range and the shape of the neighborhood, and the threshold. Every change is applied immediately, even while the animation is running.
  3. Set the size of the grid - Choose the number of columns and rows and the size of each cell. A bigger grid gives more room for the spirals, but it takes more time to compute.
  4. Adjust the speed - Choose how many generations are computed per second, or turn on the maximum speed.
  5. Disturb the waves - Click and drag on the grid to add random noise. New waves and spirals are born from it, and a frozen grid comes back to life.
  6. Pick the colors - Choose one of the palettes, or a gradient between two colors of your choice.
  7. Download it - Save the current generation as a PNG image, or open the "Generate and download video" section to record the animation as a video in WebM format.

What is a cyclic cellular automaton?

The cyclic cellular automaton was introduced by the mathematician David Griffeath and made famous by A. K. Dewdney in his column in Scientific American in 1989. Every cell of the grid has one of C colors, numbered from 0 to C - 1 and arranged in a cycle, so the color after C - 1 is 0 again.

On every generation, all the cells are updated at the same time with one rule: a cell of color k takes the color k + 1 if at least T of its neighbors already have the color k + 1. Otherwise, it keeps its color. The neighbors are all the cells at a distance of at most R (the range), in a square (the Moore neighborhood) or in a diamond (the von Neumann neighborhood).

Starting from random noise, the automaton usually goes through four phases: the noise first dissolves into a debris of small blobs, then droplets of consecutive colors form, then small cycles of colors called demons appear and send out waves, and finally the demons grow into spirals that cover the whole grid and turn forever.

The notation of the rules

A cyclic rule is written as R/T/C/N: the range, the threshold, the number of colors and the neighborhood (NM for Moore, NN for von Neumann). The classic 313 rule, R1/T3/C3/NM, has a range of 1, a threshold of 3, 3 colors and the Moore neighborhood of 8 cells.

RuleDescription
313 (R1/T3/C3/Moore)The classic rule of David Griffeath. The noise first forms small droplets, then a few "demons" appear and grow into spirals that take over the whole grid.
Perfect spirals (R1/T3/C4/Moore)Four colors that end in very regular spirals, turning forever.
Imperfect spirals (R1/T2/C4/Moore)With a lower threshold, the waves start almost immediately and the spirals keep small defects.
Cyclic spirals (R3/T5/C8/Moore)A large neighborhood and 8 colors give wide, smooth spirals.
Turbulent phase (R2/T5/C8/Moore)The waves stay turbulent for a long time, until a few spirals win.
Squarish spirals (R2/T2/C6/von Neumann)The diamond shaped neighborhood draws spirals with square corners.
Stripes (R3/T4/C5/von Neumann)The waves line up into long parallel stripes that travel across the grid.
Maps (R2/T3/C5/von Neumann)The grid is divided into patches of waves with sharp borders, like the countries of a map.
Cubism (R2/T5/C3/von Neumann)Waves with straight, angular fronts.
CCA (R1/T1/C14/von Neumann)The original cyclic cellular automaton, with 14 colors and the smallest neighborhood: the noise slowly organizes into large spiral waves.
Lava lamp (R2/T10/C3/Moore)Large blobs that slowly flow and merge, like the wax of a lava lamp.
Fossil debris (R2/T9/C4/Moore)A high threshold: most of the grid freezes into fossils, and a few waves keep moving through the debris.
3-color bootstrap (R2/T11/C3/Moore)An even higher threshold: most of the noise is frozen, and only a few nuclei manage to grow.
Amoeba (R3/T10/C2/von Neumann)Two colors that keep invading each other, with ragged borders that move like amoebas.
Black vs White (R5/T23/C2/von Neumann)Two colors fight with a very large neighborhood, forming thick regions that slowly change.
Rock paper scissors (R1/T3/C3/Moore, random)Three species where each one eats the next one, like rock, paper and scissors. The random threshold gives organic, turbulent spirals.

Options

Below are all the options you can configure in this cyclic cellular automaton simulator.

FieldDescription
Rule presetOne of the classic cyclic rules. Choosing a preset sets the four numbers of the rule and starts the simulation again.
Number of colorsThe number of colors of the cycle, from 2 to 24. More colors give thinner and more numerous waves.
Range of the neighborhoodThe distance, in cells, up to which a cell looks at its neighbors, from 1 to 5. A larger range gives larger and smoother shapes, but it is slower to compute.
Shape of the neighborhoodMoore uses all the cells in a square around the cell; von Neumann only uses the cells in a diamond, which gives shapes with straight diagonal borders.
ThresholdThe number of neighbors of the next color needed for a cell to change color. A low threshold gives fast, chaotic waves; a high threshold freezes most of the grid.
Randomness of the thresholdA random number from 0 to this value is added to the threshold of every cell on every generation. It turns the regular spirals into the organic, turbulent patterns of the rock paper scissors automaton.
Columns, rows and size of the cellThe size of the grid in cells, and the size of each cell in pixels. The image is the number of columns multiplied by the size of the cell, by the number of rows multiplied by the size of the cell.
Wrap the edges of the gridTurned on, the grid is a torus: the cells of a border are neighbors of the cells of the opposite border. Turned off, the cells outside the grid never count as neighbors.
Seed of the random noiseThe number used to generate the first generation. The same seed always gives the same noise.
Size of the brushThe diameter, in cells, of the random noise added when you click on the grid.
Generations per second and maximum speedHow fast the simulation runs.
PaletteThe colors given to the cycle. Every palette is a cycle too, so the last color blends back into the first one and the waves have no visible seam.

Frequently Asked Questions (FAQ)

Is this cyclic cellular automaton simulator free?

Yes. The tool is completely free, there is no registration, and everything is computed by your own browser: nothing is uploaded to a server.

Why did the grid stop changing?

When the threshold is too high compared to the number of neighbors, no cell ever has enough neighbors of the next color, and the grid freezes. Lower the threshold, increase the range, or click on the grid to add some noise.

Why are there no spirals yet?

The spirals need time to appear: first the noise turns into blobs and droplets, and only then the demons are born and grow. With the 313 rule on a grid of 200 x 150 cells, the spirals usually take over after a few hundred generations. Turn on the maximum speed to get there faster.

What is the rock paper scissors automaton?

It is a cyclic automaton with 3 colors, where each color beats the next one like rock, paper and scissors. Adding a random value to the threshold of every cell makes the fronts of the waves irregular, which gives the organic spirals seen in many videos. Choose the "Rock paper scissors" preset to try it.

Can I download the animation as a video?

Yes. Open the "Generate and download video" section, choose the framerate, click "Generate video", and click "Stop recording and download video" when you have enough. The video is recorded in the WebM format.

Can I use the images and the videos commercially?

Yes. The images and videos you generate are yours, and you can use them in any project.

Related tools

Game of Life

Game of Life

Create Conway's Game of Life simulations and animations.
Elementary Cellular Automaton

Elementary Cellular Automaton

Draw the 256 elementary cellular automata, like Rule 30, Rule 90 and Rule 110.
Langton's Ant

Langton's Ant

Simulate Langton's ant and its multi-color variants, and download images and videos.
Abelian Sandpile Generator

Abelian Sandpile Generator

Drop grains of sand on a grid and watch them topple into a fractal.

Turmite

Simulate turmites, the two-dimensional Turing machines, and download images and videos.
Huegene

Huegene

Create images and animations inspired by huegene cellular automata.
Turing Pattern Generator

Turing Pattern Generator

Generate Turing Pattern images.