hex

package
v0.0.0-...-07010e4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	East      = "e"
	SouthEast = "se"
	SouthWest = "sw"
	West      = "w"
	NorthWest = "nw"
	NorthEast = "ne"
)

Variables

This section is empty.

Functions

func AllDirs

func AllDirs() []string

Types

type Grid

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

func NewGrid

func NewGrid() *Grid

func (*Grid) AdjacentBlack

func (g *Grid) AdjacentBlack(pos Pos) []Pos

func (*Grid) AdjacentWhite

func (g *Grid) AdjacentWhite(pos Pos) []Pos

func (*Grid) Flip

func (g *Grid) Flip(path Path)

func (*Grid) Next

func (g *Grid) Next()

func (*Grid) NumBlackTiles

func (g *Grid) NumBlackTiles() int

func (*Grid) WhiteTiles

func (g *Grid) WhiteTiles() map[Pos]bool

type Path

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

func ParsePath

func ParsePath(s string) (Path, error)

type Pos

type Pos struct {
	X, Y int
}

func (Pos) Path

func (p Pos) Path(path Path) Pos

func (Pos) Step

func (p Pos) Step(dir string) Pos

Jump to

Keyboard shortcuts

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