Wardian docs

Game of Life

Try it

The app runs here in your browser. Nothing you type leaves it. Open it on its own.

Download life.wardian Import it in Wardian: Settings → Import.

A Wardian page app: Conway's Game of Life, with the whole simulation in WebAssembly. Press Play, or Step one generation at a time. Click or drag on the board to draw cells. Load a classic pattern, fill the board at random, or switch the rule to HighLife or Seeds.

Why a page: the world is a grid of thousands of cells, and the app needs a canvas and live controls. A module app passes only numbers. It is a page and not a suite because it has one job, and every panel works on the same world.

FileWhat it is
index.htmlThe page: the run, world and help panels, and the board.
app.jsPlays the generations, draws the board, reads clicks, and holds the patterns.
src/lib.rsThe world: init, set_rule, set_cell, get_cell, clear, randomize, step, population, render.
app.wasmBuilt from src/lib.rs by ./build.sh.
ui/The Wardian component library: theme, button, field, card, switch and Arrange.

How the data moves:

The edges wrap around: a glider that leaves on the right comes back on the left.

Patterns: glider, lightweight spaceship, Gosper glider gun, pulsar, R-pentomino, acorn, and the HighLife replicator. They are written in RLE, the text format Life programs share, so adding one to PATTERNS in app.js takes one line.

Motion: the board starts playing when it opens. If your system asks for less motion (prefers-reduced-motion), it starts paused and says why.

Limits:

The panels are Arrange panels (data-panel): each viewer may reorder them, move them between the two columns, or hide them.

This page is apps/life/README.md in the repository. Something wrong or missing? Change that file.