Pixels That Think

160 students • 4 weeks • Summer 2025

Workshop site homepage showing Pixels That Think title with colourful cellular automata pattern
The workshop site with an interactive 1D cellular automata demonstration.

We ran a 4-hour workshop on cellular automata for 160 high school students through the Ashoka Young Scholars Programme. The workshop ran over four weeks in May and June 2025, with students from grades 9 to 12.

Most of these students had never written code, so we needed to teach emergence and computation in a way that stayed playful.

Approach

The first activity had no screens at all. Students stood in a grid holding cards (white for alive, black for dead) and applied the neighbour rules to each other, so they could feel how the logic worked before writing any code.

We projected a custom p5.js simulation onto the ceiling while students worked on laptops below. This kept the Game of Life visible overhead as a shared reference without taking over their screens.

We began with 1D Wolfram rules to build intuition, then moved to the full 2D Game of Life. By day two, students were filling in scaffolded code templates for grid initialisation, neighbour counting, and rule application. Each student left with a working simulation.

Co-teaching

Yesirat Sanni, a third-year Mathematics and Computer Science student interning with the Makerspace and Young Scholars Programme, led most of each session. We designed the material and pedagogy together, tweaking activities between batches based on what we observed working in class. Yesirat handled the conceptual explanations and debugging; I took care of the unplugged demonstrations, p5.js simulation, and code-along portions.

Workshop Structure

Day 1

  • Introduction to cellular automata, from 1D rules to the 2D Game of Life
  • Unplugged demonstration with students acting as cells
  • Interactive simulation to explore gliders, oscillators, and still lifes
  • Project setup in the p5.js web editor
  • Designing cellular automata art for a public gallery

Day 2

  • Code-along with scaffolded templates
  • Grid initialisation, neighbour counting, rule application
  • Each student leaves with a working Game of Life simulation

Technical Notes

The grid uses toroidal topology, meaning cells at the right edge neighbour cells on the left. We handle this with modular arithmetic: (x + i + cols) % cols.

To avoid corrupting state mid-computation, we use double-buffering with two grids swapped each frame: [grid, nextGrid] = [nextGrid, grid].

The simulation code is split into gameLogic.js, grid.js, display.js, ui.js, and patterns.js.

Links