maze

package
v0.0.0-...-b1c8a7e Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2020 License: MIT Imports: 7 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 {
	Top    bool
	Bottom bool
	Left   bool
	Right  bool

	In      bool
	Visited bool
	End     bool
	Start   bool
}

func (*Cell) Blocked

func (c *Cell) Blocked() bool

type CellIndex

type CellIndex struct {
	Col int
	Row int
}

func (*CellIndex) Equal

func (c *CellIndex) Equal(other *CellIndex) bool

func (*CellIndex) GetID

func (c *CellIndex) GetID(cols int) int

type Maze

type Maze struct {
	Rows  int
	Cols  int
	Start CellIndex
	End   CellIndex
	Cells [][]Cell
}

func NewMaze

func NewMaze(rows, cols int) *Maze

func (*Maze) AsciiDraw

func (m *Maze) AsciiDraw()

func (*Maze) Create

func (m *Maze) Create(rows, cols int)

func (*Maze) Image

func (m *Maze) Image(outImage string) error

func (*Maze) ImageWithMultiplePaths

func (m *Maze) ImageWithMultiplePaths(paths [][]*CellIndex, outImage string, cellColors []color.Color) error

func (*Maze) ImageWithPath

func (m *Maze) ImageWithPath(path []*CellIndex, outImage string, cellColor color.Color) error

func (*Maze) UnVisitAll

func (m *Maze) UnVisitAll()

func (*Maze) VisitCell

func (m *Maze) VisitCell(row, col int)

Jump to

Keyboard shortcuts

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