maze2

package
v0.0.0-...-d7572e3 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package maze2 make maze by Growing Tree algorithm from http://weblog.jamisbuck.org/2011/1/27/maze-generation-growing-tree-algorithm

Index

Constants

This section is empty.

Variables

View Source
var DX = map[Dir]int{E: 1, W: -1, N: 0, S: 0}
View Source
var DY = map[Dir]int{E: 0, W: 0, N: -1, S: 1}
View Source
var OPPOSITE = map[Dir]Dir{E: W, W: E, N: S, S: N}

Functions

This section is empty.

Types

type Dir

type Dir int
const (
	N Dir = 1
	S Dir = 2
	E Dir = 4
	W Dir = 8
)

func (Dir) String

func (d Dir) String() string

type Maze

type Maze struct {
	W       int
	H       int
	PosList [][2]int
	Cells   [][]Dir
}

func New

func New(rnd *g2rand.G2Rand, w, h int) *Maze

func (*Maze) MazeString

func (m *Maze) MazeString() string

func (*Maze) ToBoolMatrix

func (m *Maze) ToBoolMatrix(w, h int, conerFill bool) (boolmatrix.BoolMatrix, error)

Jump to

Keyboard shortcuts

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