Source: https://mokxi.com/teachers/plans/generative-art-and-simulations
Updated: 2026-11-19

Lesson plan

# Generative art and cellular automata lesson plan

Turn a 16x16 LED panel into a night sea in C++ on an ESP32-C3: the Game of Life, random walks, L-systems, noise, flocking fish and a living light wall.

4 chapters, 7 lessons, about 5 hours, on the ESP32-C3-DevKitM-1. Every lesson runs in the browser, with nothing to install.

Start a class from this course

The unit

## Objectives and materials

### By the end, students can

- Cellular automata and random walks: simple rules, rich results.
- Plants from rewriting rules and a tide from noise.
- A school of fish from three rules, and the grid under it all.
- Everything on one living light wall.

### Materials for the whole unit

- Addressable RGB LEDs
- ESP32-C3-DevKitM-1
- Full-size breadboard

Every part is already on the simulator’s bench, so there is nothing to buy or hand out. The counts are the most any one lesson uses, if you build it on real breadboards too.

Chapter 1. About 1 h 30 min

## Rules and chance

Cellular automata and random walks: simple rules, rich results.

Lesson | Time | What students do

Game of Life Conway's two rules on a 16x16 torus of LEDs: a plankton bloom from five cells, rules as bitmasks, and a fingerprint that notices when the colony settles. | 40 min

- Two rules
- The bloom
- Check one generation by hand
- Spot the end
- Change the universe

Random walks Plankton that drift by coin flips, a random number generator in three shifts, fading trails, and 64 invisible walkers that check the square root law of diffusion. | 50 min

- One step at a time
- Glowing trails
- The square root law
- Why the square root
- A different sea
- A swarm

### Materials

- Addressable RGB LEDs
- ESP32-C3-DevKitM-1
- Full-size breadboard

### Check for understanding

Each student finishes "Random walks" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "A swarm".

Chapter 2. About 1 h 20 min

## Growth and texture

Plants from rewriting rules and a tide from noise.

Lesson | Time | What students do

L-systems Kelp from a rewriting rule: a string that grows every generation, and a turtle with a stack that turns its symbols into branches. | 40 min

- Rewrite everything at once
- A turtle with a stack
- Count by hand
- A new rule
- One more generation

Noise fields Value noise in integer math: a hashed lattice, smoothstep blending and octaves make a drifting bioluminescent tide, measured against plain random static. | 40 min

- Static versus smooth
- The tide
- No creases
- Bigger swells
- Octaves

### Materials

- Addressable RGB LEDs
- ESP32-C3-DevKitM-1
- Full-size breadboard

### Check for understanding

Each student finishes "Noise fields" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Octaves".

Chapter 3. About 1 h 15 min

## Swarms and space

A school of fish from three rules, and the grid under it all.

Lesson | Time | What students do

Flocking Twelve fish, three local rules and no leader: separation, alignment and cohesion, and an order number that shows a school appear out of a swarm. | 35 min

- Three rules, no leader
- Fish on the panel
- Each fish sees only its neighbors
- Turn on alignment

Mapping a matrix From x and y to a place on one long wire: serpentine rows, the function every lesson has leaned on, and rotation for free. | 40 min

- One strip, folded
- Exactly the fish
- Map one by hand
- Rotate for free
- Rewire it straight

### Materials

- Addressable RGB LEDs
- ESP32-C3-DevKitM-1
- Full-size breadboard

### Check for understanding

Each student finishes "Mapping a matrix" on their own, without opening the hints. The simulator checks 5 of its 5 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Rewire it straight".

Chapter 4. About 50 min

## Project

Everything on one living light wall.

Lesson | Time | What students do

Project: a living light wall Four scenes from the course on one panel, a plankton bloom, drift, a noise tide and a fish school, played from a playlist you can rearrange and extend. | 50 min

- Four scenes, one wall
- It glows
- The playlist moves on
- A faster show
- Your running order
- Add your own scene

### Materials

- Addressable RGB LEDs
- ESP32-C3-DevKitM-1
- Full-size breadboard

### Check for understanding

Each student finishes "Project: a living light wall" on their own, without opening the hints. The simulator checks 6 of its 6 steps as they go.

Then ask each one to explain, in a sentence or two, the last thing it asked of them: "Add your own scene".

Your class

## Teach this unit as a class

Start a class from this course and its 7 lessons are assigned in one go, in order. Students join with a six-character code or printed login cards, and each one’s work comes back to you.

The class tools are free for 30 days for one class of up to 20 students, with no card. The lessons themselves are free either way.

Start a class from this course See the demo class

More units

## Other lesson plans

Electronics basics 20 lessons, about 10 h. Embedded on the Arduino Uno 16 lessons, about 12 h. Embedded on the ESP32-C3 13 lessons, about 11 h. Embedded on the Raspberry Pi Pico 7 lessons, about 6 h. Build your own fight stick 5 lessons, about 4 h. Embedded on the STM32F411 6 lessons, about 6 h. C++ on a board 13 lessons, about 10 h. Digital logic and memory 4 lessons, about 4 h. Interactive devices on the Uno 9 lessons, about 8 h. From gates to a computer 23 lessons, about 16 h. Build a claw machine 8 lessons, about 6 h. Every unit All the courses as ready-made units, on the teachers page.
