Powered by AppSignal & Oban Pro
Would you like to see your link here? Contact us

Mazes

mazes.livemd

Mazes

Mix.install([{:mazes, path: "~/projects/elixir_mazes"}])

Square Grid

{grid, _} = Grid.new(25,25)
|> Grid.prepare_grid()
|> RecursiveBacktracker.on()

grid

Weave Grid

{grid, _} = Grid.new(25,25, :square, true)
|> Grid.prepare_grid()
|> RecursiveBacktracker.on()

grid
grid.under_cells
grid.links
    |> Enum.map(fn {{k, _}, _} -> k end)
    |> MapSet.new()
    |> MapSet.member?(%Cell{row: 5, col: 15, over: false})

Polar Grid

grid = Grid.new(6,6, :polar)
|> Grid.prepare_grid()
|> RecursiveBacktracker.on()
|> elem(0)