"Wave Collapse Function" algorithm in Processing

Well, somebody could translate but some is just gibberish…

:wink: