home/ atoms/ cellular-automata

Cellular automata generate emergent global patterns from cells that update on local neighbour rules

A cellular automaton (CA) is a grid of cells, each in a finite state (e.g. on/off, or 0–255), that all update simultaneously in discrete steps. Each cell’s next state depends only on its current state and its immediate neighbours — a purely local rule; no cell has global knowledge, yet rich global behaviour emerges: steady states, oscillators, gliders, and chaos. Implementation uses a two-phase update: first compute every cell’s nextState from current states, then apply all nextStates and redraw. This ordering is essential — updating cells in place would let a cell read already-updated neighbours mid-cycle, corrupting the result. Different rule sets give radically different looks: Conway’s Game of Life (biological organisms), Brian’s Brain (neural impulse waves), Vichniac Vote (geological terrain). Rules can be 1D (Wolfram encodes a rule as an 8-bit integer over the 8 neighbourhood configurations) or 2D, and extended with non-standard neighbour counts, probabilistic transitions, or 3D grids. A common misconception is that random-looking output requires randomness in the rule; fully deterministic CAs like Rule 30 produce statistically random-looking sequences.

Examples

Conway’s Game of Life: a live cell with 2–3 live neighbours survives; a dead cell with exactly 3 becomes alive; otherwise it dies. Brian’s Brain: three states (firing/resting/off) mimic neuron firing. Wolfram Rule 90 on a 1D row over 100 generations yields a triangular (Sierpinski) fractal. Implement in p5.js or Hydra, colouring cells by generation age.

Assessment

Explain why nextState must be computed for all cells before any transition, and what visual artifact appears if you violate this. Implement a 2D CA with a custom (non-Conway) rule, or a 1D Rule 90 over 100 pixels/generations, and explain how deterministic rules can produce apparently random output.

“A 2D 1 CA is a grid of cells (see figure 7.1), each of which has only two states: on and off, black or white, alive or dead. Each cell has limited local knowledge, only able to see its eight immediate neighbors.”
corpus · generative-art-a-practical-guide-using-processing-matt-pears · chunk 30
“Crazy automaton. Cellular automata with crazy rules.”
corpus · genuary-daily-generative-art-prompts-exercise-set · chunk 1
“if ((a == on ) && (b == on ) && (c == on )) { return rules[0]; }”
corpus · processing-handbook-no-login-mirror-pdf-reas-and-fry · chunk 95