CellularAutomaton¶
Generates a cellular automaton evolution.
The step specification {{t}} returns just the state at step t, wrapped in
a list ({t} behaves like the bare t form, giving all steps 0 through t):
Two-dimensional rules take a weight matrix and a range specification.
{{t1, t2, dt}} selects the states at steps t1 through t2 in
increments of dt:
$ wo 'ArrayPlot /@ CellularAutomaton[{942, {2, {{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}}, {1, 1}}, {{{1}}, 0}, {{10, 30, 10}}]'
{-Graphics-, -Graphics-, -Graphics-}
A second element in the step specification restricts the cells returned.
All keeps every affected cell, while {x1, x2} names offsets relative to
the first cell of the initial condition:
$ wo 'CellularAutomaton[90, {{1}, 0}, {3, {-2, 2}}]'
{{0, 0, 1, 0, 0}, {0, 1, 0, 1, 0}, {1, 0, 0, 0, 1}, {0, 1, 0, 1, 0}}
Without a step count only one step runs, and just the new state comes back —
as a {cells, {background}} pair when the initial condition has a background:
The operator form does the same: