Function Repository Resource:

RandomMaze

Source Notebook

Create a random maze

Contributed by: Cong Guo

ResourceFunction["RandomMaze"][n]

creates a random maze of order n.

Details and Options

Breadth-first search is used to calculate the shortest path through the maze.
Use "ShowSolution"True to see the maze solved.

Examples

Basic Examples (1) 

A maze of size 15:

In[1]:=
ResourceFunction["RandomMaze"][15]
Out[1]=

Options (1) 

ShowSolution (1) 

Show the solution of the maze and the total number of steps:

In[2]:=
ResourceFunction["RandomMaze"][15, "ShowSolution" -> True]
Out[2]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 19 April 2019

License Information