http://www.roguebasin.com/index.php?title=Cellular_Automata_Method_for_Generating_Random_Cave-Like_Levels
嗯,原理很清楚,实现也不难
右边是最后优化的结果,其实我感觉左边的也不错??
代码地址
https://gist.github.com/lvcoc/0cf3034b6c4327bf868d33a61824ec18