Falling sand

A cellular workshop where sand, water, fire, plant and fuse interact, and a known scene hashes after N ticks.

This is a browser game spec on Spekkr, published by nova. It is listed with the other specs. Paste the line to an agent that can open a web address, and the agent fetches the files and builds from them.

Spec
nova/falling-sand
Version
0.2.2
Published by
nova
Updated
15 Nov 2026

Build this spec

Build the spec at https://spekkr.com/nova/falling-sand/start.md.

Paste this to your AI agent. It opens the address, fetches the spec's files, records your choices and builds from them. Nothing to install, no account.

Published by nova.

What does the result look like?

Falling sand: heroFalling sand: loop

What can I customize?

Palette Colours for the elements and the desk.

Your choices go into the line you copy. Anything else is yours to edit, but it leaves the tested path.

What do I get?

  • spec.md Requirements and acceptance checks.

    Falling sand

    What this builds

    A grid of cells. Each cell is empty or one of a small set of elements: sand, water, fire, plant, fuse, and ash. They fall, flow, burn and grow by local rules. A person paints with a brush and can save a scene. The rules are original and fully listed. Tests run on tiny grids and on one known scene that must hash to a golden frame after a stated number of ticks.

    Read spekkr.inputs.json first. width and height size the grid. wind and seed add a sideways bias. wrap is for the sides. palette changes colours, not rules.

    Out of scope

    • A live community gallery in the checks.
    • Network, accounts, or a room where strangers' scenes appear.
    • Elements beyond the six named here, in this version.

    Requirements

    Each requirement has an id. Checks name the id they cover.

    R1. The grid
    • A cell is one of empty, sand, water, fire, plant, fuse, ash.
    • A tick updates every cell from the previous grid, in the order and with the rules in design.md.
    • The same grid and the same seed produce the same next grid.

    Accept when: two ticks of a 4 by 4 fixture match the documented next grids bit-identically.

    R2. Element rules
    • Sand falls down, or down-left or down-right if down is solid, preferring left when wind is off.
    • Water falls like sand, and also slides left or right on a floor.
    • Fire consumes fuse in a von Neumann neighbour and becomes ash after 3 ticks. Plant next to water may grow into an empty neighbour, at most one cell per 8 ticks.
    • Ash is solid and does not fall.

    Accept when: the tiny-grid cases in design.md all hold: water flows down, fire consumes fuse, sand piles, plant grows.

    R3. A known scene
    • fixtures/scene-fountain.bin is a 128 by 128 scene. After 240 ticks with wind off, a PNG of the grid hashed with the palette studio matches the golden water-flow frame, and a cell-count checksum matches the figure in design.md.

    Accept when: the checksum matches, and the frame is within the screenshot tolerance.

    R4. Painting and files
    • A brush paints the chosen element in a 1, 3 or 5 cell radius. Painting is the only input besides play/pause and a reset.
    • One command runs the tiny-grid tests, the known scene, and writes the four screenshots. No network.

    Accept when: the command passes at 32 by 32 and at the default size, with wind on and off.

    R5. Inputs
    • The build reads spekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices.
    • A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key.

    Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check.

    Verification

    Cellular tests on tiny grids assert that water flows down, fire consumes fuse, sand piles, and plant grows, exactly as the case file says. A known 128 by 128 scene is ticked 240 times and must match a checksum and a golden frame. No network and no live gallery.

    Definition of done

    • Every acceptance check above runs from one command, and all pass at the person's inputs.
    • A README says how to paint, how to run the checks, and how to add an element later.
    # Falling sand
    
    ## What this builds
    
    A grid of cells. Each cell is empty or one of a small set of elements:
    sand, water, fire, plant, fuse, and ash. They fall, flow, burn and grow by
    local rules. A person paints with a brush and can save a scene. The rules
    are original and fully listed. Tests run on tiny grids and on one known
    scene that must hash to a golden frame after a stated number of ticks.
    
    Read `spekkr.inputs.json` first. `width` and `height` size the grid.
    `wind` and `seed` add a sideways bias. `wrap` is for the sides. `palette`
    changes colours, not rules.
    
    ## Out of scope
    
    - A live community gallery in the checks.
    - Network, accounts, or a room where strangers' scenes appear.
    - Elements beyond the six named here, in this version.
    
    ## Requirements
    
    Each requirement has an id. Checks name the id they cover.
    
    ### R1. The grid
    
    - A cell is one of `empty`, `sand`, `water`, `fire`, `plant`, `fuse`,
      `ash`.
    - A tick updates every cell from the previous grid, in the order and with
      the rules in `design.md`.
    - The same grid and the same seed produce the same next grid.
    
    Accept when: two ticks of a 4 by 4 fixture match the documented next grids
    bit-identically.
    
    ### R2. Element rules
    
    - Sand falls down, or down-left or down-right if down is solid, preferring
      left when `wind` is off.
    - Water falls like sand, and also slides left or right on a floor.
    - Fire consumes fuse in a von Neumann neighbour and becomes ash after 3
      ticks. Plant next to water may grow into an empty neighbour, at most one
      cell per 8 ticks.
    - Ash is solid and does not fall.
    
    Accept when: the tiny-grid cases in `design.md` all hold: water flows
    down, fire consumes fuse, sand piles, plant grows.
    
    ### R3. A known scene
    
    - `fixtures/scene-fountain.bin` is a 128 by 128 scene. After 240 ticks
      with `wind` off, a PNG of the grid hashed with the palette `studio`
      matches the golden `water-flow` frame, and a cell-count checksum matches
      the figure in `design.md`.
    
    Accept when: the checksum matches, and the frame is within the screenshot
    tolerance.
    
    ### R4. Painting and files
    
    - A brush paints the chosen element in a 1, 3 or 5 cell radius. Painting
      is the only input besides play/pause and a reset.
    - One command runs the tiny-grid tests, the known scene, and writes the
      four screenshots. No network.
    
    Accept when: the command passes at 32 by 32 and at the default size, with
    wind on and off.
    
    ### R5. Inputs
    
    - The build reads `spekkr.inputs.json`. Settings label the UI, options
      turn features on or off, and a swap must be one of its choices.
    - A value outside a stated range, or a swap that is not one of its
      choices, is refused before the app starts its checks, with a message
      that names the key.
    
    Accept when: the default inputs render, an illegal swap is refused by
    name, and changing a visible setting (for example the title) shows up in a
    later check.
    
    ## Verification
    
    Cellular tests on tiny grids assert that water flows down, fire consumes
    fuse, sand piles, and plant grows, exactly as the case file says. A known
    128 by 128 scene is ticked 240 times and must match a checksum and a
    golden frame. No network and no live gallery.
    
    ## Definition of done
    
    - Every acceptance check above runs from one command, and all pass at the
      person's inputs.
    - A README says how to paint, how to run the checks, and how to add an
      element later.
    

    Open spec.md as plain text

  • design.md Element rules, tiny-grid cases and the known-scene checksum.

    Design

    This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold.

    Tick order

    Scan from the bottom row to the top, left to right. A cell that already moved this tick is skipped. Neighbour reads are from the previous grid.

    Tiny-grid cases

    Each case is a before/after pair in fixtures/sand-cases.json. The cases include: a single sand cell on empty space falls one row; water on a floor spreads one cell left and right over two ticks; fire next to fuse turns that fuse into fire and itself into ash after 3 ticks; plant next to water fills one empty neighbour after 8 ticks.

    Known scene checksum

    After 240 ticks of fixtures/scene-fountain.bin, wind off, no wrap: counts are recorded in fixtures/scene-fountain-240.json (empty, sand, water, fire, plant, fuse, ash). Tests compare those counts exactly, then compare the PNG.

    Screenshots

    These pictures are headless-Chrome captures of the working reference in reference/preview.html, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel.

    FileWhat it shows
    shots/scene.pngThe default 128×128 scene after the dune has slumped: sand, water, plant, fuse and fire.

    Inputs

    KeyLabelDefaultNotes
    widthGrid width128From 32 to 512, a power of two.
    heightGrid height128From 32 to 512, a power of two.
    seedWind seed1A whole number. Used only when wind is on.
    windA little windoffA weak sideways bias on powder and water, seeded.
    wrapWrap left and rightoffCells that leave one side enter the other. The floor still blocks.
    palettePalettestudioColours for the elements and the desk.

    Acceptance at the defaults

    The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins.

    FixtureRole
    design.mdA shipped fixture. The build may move it, but then design.md must name the new path.
    fixtures/sand-cases.jsonA shipped fixture. The build may move it, but then design.md must name the new path.
    fixtures/scene-fountain-240.jsonA shipped fixture. The build may move it, but then design.md must name the new path.
    spekkr.inputs.jsonA shipped fixture. The build may move it, but then design.md must name the new path.

    Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy.

    How to verify

    1. Run the checks at the default inputs, without a network.
    2. Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file.
    3. Repeat once at the person's inputs when they differ from the defaults.
    4. Cellular tests on tiny grids assert that water flows down, fire consumes fuse, sand piles, and plant grows, exactly as the case file says. A known 128 by 128 scene is ticked 240 times and must match a checksum and a golden frame. No network and no live gallery.
    # Design
    
    This file fixes the parts that are easy to get wrong. The language and
    tools are up to you, as long as the numbers here hold.
    
    ## Tick order
    
    Scan from the bottom row to the top, left to right. A cell that already
    moved this tick is skipped. Neighbour reads are from the previous grid.
    
    ## Tiny-grid cases
    
    Each case is a before/after pair in `fixtures/sand-cases.json`. The cases
    include: a single sand cell on empty space falls one row; water on a floor
    spreads one cell left and right over two ticks; fire next to fuse turns
    that fuse into fire and itself into ash after 3 ticks; plant next to water
    fills one empty neighbour after 8 ticks.
    
    ## Known scene checksum
    
    After 240 ticks of `fixtures/scene-fountain.bin`, `wind` off, no wrap:
    counts are recorded in `fixtures/scene-fountain-240.json` (empty, sand,
    water, fire, plant, fuse, ash). Tests compare those counts exactly, then
    compare the PNG.
    
    ## Screenshots
    
    These pictures are headless-Chrome captures of the working reference in
    `reference/preview.html`, at the default inputs. They are not drawings of a
    product that has not been built. The first picture is the one Spekkr shows on
    the spec's card. A build may ship its own goldens; those goldens are of that
    build and do not have to match these frames pixel-for-pixel.
    
    | File | What it shows |
    | --- | --- |
    | `shots/scene.png` | The default 128×128 scene after the dune has slumped: sand, water, plant, fuse and fire. |
    
    
    ## Inputs
    
    | Key | Label | Default | Notes |
    | --- | --- | --- | --- |
    | `width` | Grid width | 128 | From 32 to 512, a power of two. |
    | `height` | Grid height | 128 | From 32 to 512, a power of two. |
    | `seed` | Wind seed | 1 | A whole number. Used only when wind is on. |
    | `wind` | A little wind | off | A weak sideways bias on powder and water, seeded. |
    | `wrap` | Wrap left and right | off | Cells that leave one side enter the other. The floor still blocks. |
    | `palette` | Palette | studio | Colours for the elements and the desk. |
    
    ## Acceptance at the defaults
    
    The numbers, names and fixture paths already in this file are the
    authority. Where a later table or a shipped fixture file disagrees with
    prose, the table or the fixture wins.
    
    | Fixture | Role |
    | --- | --- |
    | `design.md` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    | `fixtures/sand-cases.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    | `fixtures/scene-fountain-240.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    | `spekkr.inputs.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    
    Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement
    names another size. Tolerance, unless a tighter figure is given above: 8
    levels, 98% of pixels, with motion, cursors and clocks frozen as this file
    says. A build's goldens are of that build; they do not have to match a
    shipped reference preview pixel-for-pixel if the tool or the type is
    different, but they do have to match this file's layout, counts and copy.
    
    ## How to verify
    
    1. Run the checks at the default inputs, without a network.
    
    2. Walk through the scripted playthroughs, fixture lookups or goldens
    named in the requirements; each must match this file.
    
    3. Repeat once at the person's inputs when they differ from the defaults.
    
    4. Cellular tests on tiny grids assert that water flows down, fire
    consumes fuse, sand piles, and plant grows, exactly as the case file says.
    A known 128 by 128 scene is ticked 240 times and must match a checksum and
    a golden frame. No network and no live gallery.
    

    Open design.md as plain text

  • tasks.md Build tasks in order, each with a check.

    Tasks

    Work in order. Finish a task's check before starting the next.

    1. Set up. Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read spekkr.inputs.json first. Check: a blank or heading page loads, and an empty test run passes.
    2. The grid (R1). Build what R1. The grid asks for, to the numbers in design.md. In particular: A cell is one of empty, sand, water, fire, plant, fuse, ash. Check: the R1. The grid acceptance checks pass.
    3. Element rules (R2). Build what R2. Element rules asks for, to the numbers in design.md. In particular: Sand falls down, or down-left or down-right if down is solid, preferring left when wind is off. Check: the R2. Element rules acceptance checks pass.
    4. A known scene (R3). Build what R3. A known scene asks for, to the numbers in design.md. In particular: fixtures/scene-fountain.bin is a 128 by 128 scene. After 240 ticks with wind off, a PNG of the grid hashed with the palette studio matches the golden water-flow frame, and a cell-count checksum matches the figure in design.md. Check: the R3. A known scene acceptance checks pass.
    5. Painting and files (R4). Build what R4. Painting and files asks for, to the numbers in design.md. In particular: A brush paints the chosen element in a 1, 3 or 5 cell radius. Painting is the only input besides play/pause and a reset. Check: the R4. Painting and files acceptance checks pass.
    6. Inputs (R5). Build what R5. Inputs asks for, to the numbers in design.md. In particular: The build reads spekkr.inputs.json. Settings label the UI, options turn features on or off, and a swap must be one of its choices. Check: the R5. Inputs acceptance checks pass.
    7. Goldens. Capture the frames named in design.md at the defaults, with motion frozen where the file says so. Compare them within the stated tolerance. Check: the frames match, and a pixel-level check fails if a documented element is removed on purpose.
    8. Finish. Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in spec.md is true.
    # Tasks
    
    Work in order. Finish a task's check before starting the next.
    
    1. **Set up.** Set up a web app (or the stack you have chosen) and a test
    runner that can open a page, click, and compare screenshots. Read
    `spekkr.inputs.json` first.
       Check: a blank or heading page loads, and an empty test run passes.
    
    2. **The grid (R1).** Build what `R1. The grid` asks for, to the numbers
    in `design.md`. In particular: A cell is one of `empty`, `sand`, `water`,
    `fire`, `plant`, `fuse`, `ash`.
       Check: the `R1. The grid` acceptance checks pass.
    
    3. **Element rules (R2).** Build what `R2. Element rules` asks for, to the
    numbers in `design.md`. In particular: Sand falls down, or down-left or
    down-right if down is solid, preferring left when `wind` is off.
       Check: the `R2. Element rules` acceptance checks pass.
    
    4. **A known scene (R3).** Build what `R3. A known scene` asks for, to the
    numbers in `design.md`. In particular: `fixtures/scene-fountain.bin` is a
    128 by 128 scene. After 240 ticks with `wind` off, a PNG of the grid
    hashed with the palette `studio` matches the golden `water-flow` frame,
    and a cell-count checksum matches the figure in `design.md`.
       Check: the `R3. A known scene` acceptance checks pass.
    
    5. **Painting and files (R4).** Build what `R4. Painting and files` asks
    for, to the numbers in `design.md`. In particular: A brush paints the
    chosen element in a 1, 3 or 5 cell radius. Painting is the only input
    besides play/pause and a reset.
       Check: the `R4. Painting and files` acceptance checks pass.
    
    6. **Inputs (R5).** Build what `R5. Inputs` asks for, to the numbers in
    `design.md`. In particular: The build reads `spekkr.inputs.json`. Settings
    label the UI, options turn features on or off, and a swap must be one of
    its choices.
       Check: the `R5. Inputs` acceptance checks pass.
    
    7. **Goldens.** Capture the frames named in `design.md` at the defaults,
    with motion frozen where the file says so. Compare them within the stated
    tolerance.
       Check: the frames match, and a pixel-level check fails if a documented
    element is removed on purpose.
    
    8. **Finish.** Write a README that says how to install what is needed, how
    to change the inputs, and how to run the checks. Run the one command from
    a clean folder.
       Check: every item under Definition of done in `spec.md` is true.
    

    Open tasks.md as plain text

  • reference/preview.html A working reference preview of the default view, used to make the listing pictures. A build does not have to start from this file.
  • reference/fonts/fonts.css Webfont faces for the reference preview.
  • reference/fonts/Geist.ttf Geist variable typeface for the reference preview.
  • reference/fonts/Fraunces.ttf Fraunces variable typeface for the reference preview.
  • reference/fonts/Fraunces-Italic.ttf Fraunces italic variable typeface for the reference preview.

Is it for me?

Platforms
web
Tools
TypeScript

What does it need?

Agent permissions
shell
Commands it runs
install a test runner install a tool that compares screenshots

What changed?

  • 0.2.215 Nov 2026Names what it builds.
  • 0.2.115 Nov 2026Build a denser sandbox with stone ledges and mixed materials, and add an animated loop.
  • 0.2.014 Nov 2026Polished reference preview and new listing shots, including a short loop.
  • 0.1.014 Nov 2026First version.

For agents: start.md says how to build this spec, spec.json holds everything on this page, and bundle.tar.gz holds its files.