1. Divide
Partition ASplit the field into 2 × 2 blocks. This grain can interact only with the other three cells inside its outlined block.
Simple rules. Shifting neighborhoods.
A little world at your fingertips.
FOLLOW ONE GRAIN
Each square is one cell. The outlines show which cells can interact during a step.
Split the field into 2 × 2 blocks. This grain can interact only with the other three cells inside its outlined block.
There is air below the grain in its block, so sand and air exchange places. The grain reaches the bottom of this block.
Move the block outlines one cell right and down. No particles move during this shift. The grain now has a new cell below it in its block.
Update the new blocks. The grain can fall another cell. Next, return to partition A and repeat.
This is a close-up of the field's interior. Blocks that extend beyond the picture continue into the surrounding field. Every block updates independently; a grain cannot jump into a different block during that step.
First try straight down, then diagonal falls, then a possible sideways water swap. These examples show the result of one complete block update.
Air below? Swap places. Sand moves down one row; the number of grains stays the same.
Stone blocks the direct fall. With the side cell open, sand can move to the empty lower corner of this same block.
Sand is denser than water. They exchange places: sand goes down and water goes up. Neither particle disappears.
In this update, water swaps with air beside it. A randomized choice enables sideways swaps on some updates, so it does not always move.
The bottom-right cell is empty, but stone blocks both the direct fall and the side route. Sand stays put; it cannot pass through the stone corner.
Both lower cells already contain sand. No grain can fall or displace another grain of the same material in this block.
When several moves are possible, the simulation randomly chooses which column to try first. The diagrams show specific valid outcomes, not a promise that every block will choose the same direction. Stone always stays in place, and every update preserves each material's cell count.
THE SMALL RULE BEHIND THE BIG PICTURE
Each step divides the world into independent 2 × 2 blocks. The four cells in each block exchange places, then the partition shifts one cell diagonally for the next step. New neighbors let motion travel across the field.
Sand sinks through air and water, water spreads sideways, and stone stays fixed. These custom, randomized falling-sand rules conserve every particle during simulation. Painting and erasing change the total. The outer frame is sealed.
Pause and advance one step at a time to watch particles move. The examples above illustrate how partitions A and B alternate. Explore Margolus neighborhoods ↗