A Haxe port of tutorial which can be found at http://gamedev.tutsplus.com/tutorials/implementation/cave-levels-cellular-automata/