maze

package
v0.0.0-...-6b107e2 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell struct {
	NorthRoute bool
	WestRoute  bool
	Visited    bool
}

cell is an individual part of a maze with a route north, west, and a visited flag a "route" north, representing lack of a wall, is used instead of a wall=true as the default type for a bool is false so by default there is no route from that cell. This saves constructing cells with true values.

type Maze

type Maze struct {
	Cells [][]Cell
}

maze represents the entire maze

func New

func New(width, height int, start Position) Maze

type Position

type Position struct {
	X int
	Y int
}

type Route

type Route []Position

func (*Route) Pop

func (s *Route) Pop() Position

func (*Route) Push

func (s *Route) Push(p Position)

Jump to

Keyboard shortcuts

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