Per iteration, increment the centre of the grid, and perform any collapsing necessary (if >= 4 then sand pile "collapses" onto its cardinal directions).
Simple hello world in raylib, with a Makefile to do the compilation for me!