Documentation ¶
Overview ¶
Package maze provides generating, solving, and other utilities for working with mazes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Dijkstra = FinderFn(dijkstra)
Dijkstra is a path finder implementing Dijkstra's algorithm.
Functions ¶
Types ¶
type Finder ¶
type Finder interface { // Path returns the ids of the cells from start to end. Path(m *Maze, start, end int64) []int64 }
Finder is anything that can find a path between two cells in a maze
type Generator ¶
Generator represents anything that can generate a maze.
func WithKruskal ¶
WithKruskal2 returns a generator which uses Kruskal's algorithm to generate mazes.
type Maze ¶
type Maze struct { // Graph is the underlying structure of the maze. // IMPORTANT! This field will be deprecated and removed in the future. // It is currently only exported to keep the cli tool happy. // Graph graph.Weighted // contains filtered or unexported fields }
Maze 2D rectangular maze.
func (*Maze) Connected ¶ added in v0.0.4
Connected returns whether or not two cells in the maze are directly connected.
func (*Maze) MarshalDOT ¶
MarshalDOT marshals the maze as a graph into the DOT language.
func (*Maze) MarshalText ¶
MarshalText marshals the maze into a textual form.
func (*Maze) UnmarshalText ¶
UnmarshalText unmarshals the maze from its textual form.
Click to show internal directories.
Click to hide internal directories.