maze

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSeed

func SetSeed(seed int64)

func Solve

func Solve(maze *Maze)

Types

type Cell

type Cell struct {
	// contains filtered or unexported fields
}

func (*Cell) IsLinkedEast

func (c *Cell) IsLinkedEast() bool

func (*Cell) IsLinkedNorth

func (c *Cell) IsLinkedNorth() bool

func (*Cell) IsLinkedSouth

func (c *Cell) IsLinkedSouth() bool

func (*Cell) IsLinkedWest

func (c *Cell) IsLinkedWest() bool
func (c *Cell) Link(other *Cell)

func (*Cell) LinkEast

func (c *Cell) LinkEast() bool

func (*Cell) LinkNorth

func (c *Cell) LinkNorth() bool

func (*Cell) LinkSouth

func (c *Cell) LinkSouth() bool

func (*Cell) LinkWest

func (c *Cell) LinkWest() bool

func (*Cell) Neighbors

func (c *Cell) Neighbors() []*Cell

func (*Cell) UnvisitedNeighbors

func (c *Cell) UnvisitedNeighbors() []*Cell

func (*Cell) VisitedNeighbors

func (c *Cell) VisitedNeighbors() []*Cell

type Maze

type Maze struct {
	Width  int
	Length int

	Solution *solution
	// contains filtered or unexported fields
}

func NewMaze

func NewMaze(x, y int) *Maze

func (*Maze) Braid

func (m *Maze) Braid(percent int)

func (*Maze) GetCell

func (m *Maze) GetCell(x, y int) *Cell

func (*Maze) GetDistance

func (m *Maze) GetDistance(x, y int) int

func (*Maze) IsFullyVisited

func (m *Maze) IsFullyVisited() bool

func (*Maze) Print

func (m *Maze) Print(solve bool) string

func (*Maze) String

func (m *Maze) String() string

func (*Maze) Unvisit

func (m *Maze) Unvisit(cell *Cell)

func (*Maze) Visit

func (m *Maze) Visit(cell *Cell)

func (*Maze) Visited

func (m *Maze) Visited(cell *Cell) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL