Wolfram Research

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

A maze of size 15:

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

Options

ShowSolution

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

Resource History

License Information