Simulated sand

The idea is that you have 2 types of sand that move up and down respectively. when sand moves into another sand, it turns that sand slightly into its own color. So when a blue hits a red, the red turns slightly more purple. If the blue hits the purple, it turns it blue. There are 5 shares of colors, blue, blue-purple, purple, red-purple, red. You usually only see red and blue though, because they like to travel in clumps and change each other colors to the extreme shades.

Eventually one color will completely take over the screen. Which one is completely random. Sometimes it can be done in 5 minutes, sometimes it takes hours.

This program exists for UNIX (using MIT SHM extension of the X server) and for Win32 (using Direct Draw).

Initialization, the blues are going down, the reds are coming up.


Collision! They will mostly stop each other now.


Equilibrium. They will struggle a lot here to break through each others defenses.


Red breaks through!


Because red has weakened its defense by leaking through, it gives blue a chance to break through.


Smaller collision, more breakthrough.

Download the Win32 binary here
Download the source here