RosettaCodeData/Task/Maze-generation/00DESCRIPTION

18 lines
648 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
{{wikipedia|Maze generation algorithm}}
2016-12-05 22:15:40 +01:00
[[File:a maze.png|300px||right|a maze]]
<br>
;Task:
2013-04-10 21:29:02 -07:00
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 -->
2016-12-05 22:15:40 +01:00
<br><br>
2013-04-10 21:29:02 -07:00
2016-12-05 22:15:40 +01:00
; Related tasks
* [[Maze solving]].
<br><br>