Web Simulation 

 

 

 

 

Cellular Automata Logic Lab 

This interactive tutorial visualizes cellular automata (CA) — discrete dynamical systems where simple local rules produce emergent complexity. The simulation uses a double-buffered grid engine and supports multiple rule sets used in computer science and physics.

Mathematical Foundation

1. Grid and Neighborhood

A 2D grid of cells evolves in discrete time steps. Each cell has a state (e.g. 0 or 1 for Conway). The Moore neighborhood includes all 8 adjacent cells (orthogonal and diagonal). At each step, the new state of a cell depends only on its current state and the states of its neighbors.

2. Conway's Game of Life (B3/S23)

States: dead (0), alive (1). Birth: a dead cell with exactly 3 live neighbors becomes alive. Survival: a live cell with 2 or 3 live neighbors stays alive. Otherwise it dies. This simple rule produces gliders, oscillators, and even Turing-complete patterns like the Gosper Glider Gun.

3. Wireworld

Four states: Empty (black), Conductor (yellow), Electron Head (blue), Electron Tail (red). Rules: Head→Tail; Tail→Conductor; Conductor→Head if exactly 1 or 2 neighbors are Heads. Wireworld can simulate digital logic: diodes, clocks, and logic gates (AND, OR, XOR), proving it is Turing-complete.

4. Brian's Brain

Three states: Ready (white), Firing (blue), Refractory (gray). A ready cell fires if exactly 2 neighbors are firing; a firing cell becomes refractory; a refractory cell becomes ready. Models neural-like behavior with a refractory period.

5. Seeds

Two states. Birth: a dead cell with exactly 2 neighbors becomes alive. Survival: none (all cells die). Produces explosive, high-growth patterns.

6. Rule 30 and Rule 110 (Elementary CA)

1D cellular automata where each cell has two neighbors (left, right). The next state depends on the 3-cell pattern (L,C,R). Rule 30 produces chaotic, fractal-like patterns and is used in Mathematica's random number generator. Rule 110 is Turing-complete: it can simulate any computation. Time flows downward; the top row is the seed.

Controls
Select pattern, then click/drag on canvas to stamp.
5 0

 

Usage

Use the simulation to explore cellular automata:

  1. Rule: Select Conway, Wireworld, Brian's Brain, Seeds, Rule 30, or Rule 110. The grid re-initializes with a rule-appropriate pattern.
  2. Instruction frame: Above the grid, context-specific instructions describe what you can do for the selected rule.
  3. Pattern: Choose a preset (Glider, Gosper Gun for Conway; Clock, Diode, XOR for Wireworld; Single seed, Three cells for Rule 30/110). Click or drag on the canvas to stamp.
  4. Brush (Wireworld only): When Wireworld is selected, choose Conductor, Electron Head, or Tail to draw with.
  5. Run / Stop: Toggle the simulation. Step advances one generation. Reset re-initializes; Clear empties the grid; Randomize fills with random cells.
  6. Speed / Gen: Adjust generations per second. Gen shows total steps. Heatmap: (Conway only, shown when applicable) Color cells by age.
  7. Draw: Click or drag on the canvas to paint cells. With a pattern selected, stamp at each cell you drag over. For Rule 30/110, edit the top row (seed) for persistent effect.

Info Box

Below the grid, the Rule Info box shows the cell-by-cell operation rules and color codes for the selected rule.

Visual Guide

  • Conway/Seeds/Rule 30/110: Green = alive (or 1). Gray grid overlay when paused.
  • Wireworld: Yellow = conductor, Blue = electron head, Red = electron tail.
  • Brian's Brain: Blue = firing, Gray = refractory, grid = ready.
  • Pattern ghost: Dashed green outline shows where the selected pattern will be stamped.

Key Insights

  • Emergence: Global patterns (gliders, oscillators) arise from purely local rules.
  • Wireworld logic: Build a clock loop, then add a diode for one-way flow. The XOR gate proves Turing-completeness.
  • Brian's Brain: The refractory period prevents immediate re-firing, mimicking neural dynamics.
  • Rule 30/110: 1D CA; top row is the seed. Rule 30 is chaotic; Rule 110 is Turing-complete.