打印

[AS3] 迷宫生成与迷宫求解

这是从[email=http://godson.blueidea.com/archives/2007/5778.shtml]http://godson.blueidea.com/archives/2007/5778.shtml[/email]上面看到的。

他给出了算法:
After starting at position 2,2 on the grid, the algorithm randomly chooses an adjacent target location (up, down, left or right) that is exactly two cells away.
After making its choice, it connects its current position with that location.
When it successfully makes a choice, it remembers the new location and chooses again.
When no locations are available - it has hit a dead end - it grabs the last successful position and tries again.
When there are no available positions left to try, the maze is complete.


虽然看明白了点,可我还是无法下手去做。

想到论坛这里问问高手:树好生成,但如何让树上任何两点有且只有一条通路??
我爱慢慢吃葡萄!
千万别下沉啊!
网上顶啊!
我爱慢慢吃葡萄!
关注~~
我是想不出的~
我是看不懂的

TOP

还在为头像烦恼?还在为不能关注好友动态烦忧?快来蓝色理想家园吧!
再顶顶顶!!
哪怕给个详细的网页介绍也好啊!
谢谢啦!
我爱慢慢吃葡萄!

TOP

继续等。。。
我爱慢慢吃葡萄!

TOP