NetHack's Gnomish Mines grow their caves with cellular automata
Dungeon Generation in the Gnomish Mines of NetHack
Most of NetHack unfolds in square rooms, but the Gnomish Mines generate organic caves: seed 40% of the grid as floor, then run four passes of cellular automata. Pass 1 clusters tiles in place, passes 3 and 4 erode corners and tiny islands, and the author still can't work out what pass 2 — which turns a cell to rock when exactly five neighbors are floor — is meant to accomplish.
Pass 2 though… It turns cells to rock if they have exactly 5 floor neighbors (i.e. 3 rock neighbors). I'm still struggling to understand what purpose this is intended to achieve. Any ideas?