Difference between revisions of "Maze generation"

From Fōrmulæ wiki
Jump to: navigation, search
(Creation of page)
(No difference)

Latest revision as of 14:04, 11 October 2019

This page is a solution to the task Maze generation in the Rosetta Code, written in Fōrmulæ.

Description (from Rosetta Code)


Generate and show a maze, using the simple Depth-first search algorithm.

  1. Start at a random cell.
  2. 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.



Test case