16 lines
568 B
Plaintext
16 lines
568 B
Plaintext
<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>
|
|
|