demo 14 of 17

sand

A falling-sand toy: pour materials and watch them pile and flow.

Recordings

Both captures below are real iTerm2 sessions running the demo — the same binary renders at pixel resolution where the terminal speaks the kitty graphics protocol, and as ASCII cells everywhere else.

kitty graphics — sand-gfx

A cellular automaton on a grid of materials, updated bottom-up every frame — sand piles at its angle of repose, water and oil level out (and oil floats up through water), embers glow and cool. Filled grains opaque, empty cells transparent over your terminal.

sand in kitty graphics mode
sand — kitty pixel mode
ASCII cells — sand

The same grid at half-cell resolution, each material its own glyph and colour.

sand in ASCII cell mode
sand — ASCII cell mode

Controls

KeyAction
spacedrop a chunk
mouse clickpour at the pointer
aclear the field
ccycle material
+ / -brush size
q / Escquit

Tuning env vars use the SAND_* prefix — e.g. SAND_MAXDIM=1024 for sharper frames, SAND_CELLS=1 to force cell rendering even on kitty terminals. See the overview for the full tuning table.