RosettaCodeData/Task/Maze-generation/00DESCRIPTION

18 lines
648 B
Plaintext

{{wikipedia|Maze generation algorithm}}
[[File:a maze.png|300px||right|a maze]]
<br>
;Task:
Generate and show a maze, using the simple [[wp:Maze_generation_algorithm#Depth-first_search|Depth-first search]] algorithm.
<!-- BEGIN TEXT FROM WIKIPEDIA -->
#Start at a random cell.
#Mark the current cell as visited, and get a list of its neighbors. For each neighbor, starting with a randomly selected neighbor:
#:If that neighbor hasn't been visited, remove the wall between this cell and that neighbor, and then recurse with that neighbor as the current cell.
<!-- END TEXT FROM WIKIPEDIA -->
<br><br>
; Related tasks
* [[Maze solving]].
<br><br>