Wolfram CA

A cellular automaton is a system of cells that live on a grid, have a binary state (on or off), and a neighborhood.

Each row of the grid represents a new generation. The new generation is created by taking a cell and its two neighbors and from its pattern, determine the state of the cell directly underneath. Since we have 3 binary states, the total number of neighborhood patterns is 8.

000, 001, 010, 011, 100, 101, 110, 111

A rule determines which new state each pattern corresponds to. This rule is an eight bits number. Each bit of the number corresponds to one of the listed patterns. The number 90 for instance has the following bitpattern:

01011010

If we map the patterns to the corresponding bits of the rule, we know what kind of transformations to make.

000 001 010 011 100 101 110 111
0 1 0 1 1 0 1 0

Using 8 bits, we can create 256 rules. Not all of them will produce an interesting result, we're showing only a selection.

View code on Github