CellularAutomaton  
CellularAutomaton[rule, init, t] generates a list representing the evolution of the cellular automaton with the specified rule from initial condition init for t steps. 
CellularAutomaton[rule, init] gives the result of evolving init for one step. 
CellularAutomaton[rule, init, {tspec, xspec, ...}] gives only those parts of the evolution specified by tspec, xspec, etc. 
CellularAutomaton[rule, init, {t, All, ...}] includes at each step all cells that could be affected over the course of t steps. 
 Possible forms for rule are:
 n  , , elementary rule with rule number n 
 {n,k}  general nearestneighbor rule with k colors 
 {n,k,r}  general rule with k colors and range r 
 {n,k,{r_{1},r_{2},...,r_{d}}}  ddimensional rule with neighborhood 
 {n,k,{{off_{1}},{off_{2}},...,{off_{s}}}}  rule with neighbors at specified offsets 
 {n,k,rspec,s}  orders rule 
 {n,{k,1}}  kcolor nearestneighbor totalistic rule 
 {n,{k,1},r}  kcolor range r totalistic rule 
 {n,{k,{wt_{1},wt_{2},...}},rspec}  rule in which neighbor i is assigned weight wt_{i} 
 {lhs_{1}>rhs_{1},lhs_{2}>rhs_{2},...}  explicit replacements for lists of neighbors 
 {fun,{},rspec}  function fun to apply to each list of neighbors 
 Common forms for 2D cellular automata include:
 {n,{k,1},{1,1}}  9neighbor totalistic rule 
 {n,{k,{{0,1,0},{1,1,1},{0,1,0}}},{1,1}} 
  5neighbor totalistic rule 
 {n,{k,{{0,k,0},{k,1,k},{0,k,0}}},{1,1}} 
  5neighbor outer totalistic rule 
 The number of possible cellular automaton rules is as follows:
 elementary rules  256 
 1D general rules  
 1D totalistic rules  
 2D general rules  
 2D 9neighbor totalistic rules  
 2D 5neighbor totalistic rules  
 2D 5neighbor outer totalistic rules  
 Normally, all elements in init and the evolution list are integers between 0 and .
 When a general function or replacement list is used, the elements of init and the evolution list can be any expressions. »
 Explicit replacement rules lhs_{i}>rhs_{i} can contain patterns.
 In a 1D cellular automaton, replacement rules or an explicit function fun are always taken to apply to a 1D list of neighbors. If the neighbors are specified by explicit offsets, they are given in the order of the offsets.
 When the neighborhood in a multidimensional cellular automaton is defined by a range specification such as {r_{1}, r_{2}, ...}, the list of neighbors is taken to be a full array with dimensions 2{r_{1}, r_{2}, ...}+1.
 If the neighbors in a multidimensional cellular automaton are specified by an explicit list of offsets, the neighbors are supplied in a onedimensional list in the order of the offsets.
 If an explicit function fun is given, the first argument supplied to it is the list of neighbors. The second argument is the step number starting at 0.
 In an orders cellular automaton, specified by {rule, kspec, rspec, s}, each step depends on s preceding steps.
 Initial conditions are constructed from init as follows:
 {a_{1},a_{2},...}  explicit list of values a_{i}, assumed cyclic 
 {{a_{1},a_{2},...},b}  values a_{i} superimposed on a b background 
 {{a_{1},a_{2},...},{b_{1},b_{2},...}}  values a_{i} superimposed on a background of repetitions of b_{1}, b_{2}, ... 
 {{{{a_{11},a_{12},...},off_{1}}, {{a_{21},...},off_{2}},...},bspec} 
  values a_{ij} at offsets off_{i} on a background 
 {{a_{11},a_{12},...},{a_{21},...},...}  explicit list of values in two dimensions 
 {aspec,bspec}  values in d dimensions with ddimensional padding 
 The first element of aspec is superimposed on the background at the first position in the positive direction in each coordinate relative to the origin. This means that bspec[[1, 1, ...]] is aligned with aspec[[1, 1, ...]].
 For an orders cellular automaton, init is a list giving the initial s steps in the evolution of the system.
 Time specifications tspec in {tspec, xspec, ...} can be as follows:
 t  all steps 0 through t 
 {t}  a list containing only step t 
 {{t}}  step t alone 
 {t_{1},t_{2}}  steps t_{1} through t_{2} 
 {t_{1},t_{2},dt}  steps t_{1}, t_{1}+dt, ... 
 The initial condition is considered to be at step 0.
 Space specifications xspec can be as follows:
 All  all cells that can be affected by the specified initial condition 
 Automatic  all cells in the region that differs from the background 
 0  cell aligned with beginning of aspec 
 x  cells at offsets up to x on the right 
 x  cells at offsets up to x on the left 
 {x}  cell at offset x to the right 
 {x}  cell at offset x to the left 
 {x_{1},x_{2}}  cells at offsets x_{1} through x_{2} 
 {x_{1},x_{2},dx}  cells x_{1}, x_{1}+dx, ... 
 In one dimension, the first element of aspec is taken by default to have space offset 0.
 In any number of dimensions, aspec[[1, 1, 1, ...]] is taken by default to have space offset {0, 0, 0, ...}.
 Each element of the evolution list produced by CellularAutomaton is always the same size.
 With an initial condition specified by an aspec of width , the region that can be affected after steps by a cellular automaton with a rule of range has width .
 If no bspec background is specified, space offsets of All and Automatic will include every cell in aspec.
 A space offset of All includes all cells that can be affected by the initial condition.
 A space offset of Automatic can be used to trim off background from the sides of a cellular automaton pattern.
 In working out how wide a region to keep, Automatic only looks at results on steps specified by off_{t}.
Run rule 30 for 2 steps:
Out[1]=  
Run for 50 steps from a single 1 on a background of 0s:
Out[1]=  
 
New in 4.2  Last modified in 6






