Click on the beach to leave footprints.

Press 'space' to reset the beach, 'z' to rotate the sort direction, 'x' to change between the four pebble types (which also resets the beach), and 'c' to switch between precise and erratic sorting. You'll need to click on the beach before it accepts keypresses.

Source code
Built with Processing