Elixir Port of my ruby-maze repo.
-
Clone the repo and run in the root of the project
mix deps.get
to download the dependencies. -
Run
iex -S mix
to start theMaze.Server
-
Create and solve a default 20 x 20 maze simply with
Maze.Server.create_maze
-
Create and solve a maze with custom options with
Maze.Server.create_maze({:init, rows = 35, columns = 73, name = nil, goal_position = [70, 35], start_position = [1, 1], paint_mode = :solve, paint_interval = 100 })
The above options will create, build, solve, and paint the solved path of
a 35 x 73 maze, starting from position row 1, column 1 and ending at row 35, column 73,
with animation speed of 100 ms.
You can watch the build path instead of the solve path by changing the paint_mode
option to :build
.
Make sure start and goal positions [x, y]
you set are within the maze's boundaries.
x
should be from 1 to columns
and y
from 1 to rows
range.
- Go crazy with firing up multiple mazes at once. As simple as:
Maze.Server.create_mazes 50
The above will concurrently create and solve 50 default 20x20 mazes.
You can pass the same options as in Maze.Server.create_maze
as the second parameter
to create custom mazes:
Maze.Server.create_mazes 50, options
I had no problem with 300 mazes, see screenshot below.
The project is available as open source under the terms of the MIT License.