lib

package
v0.0.0-...-7909fbe Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

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

func NewBoard

func NewBoard(spring Pos, lines []InputLine) *Board

func (*Board) AddCursor

func (b *Board) AddCursor(pos Pos)

func (*Board) Bounds

func (b *Board) Bounds() (xmin, xmax, ymin, ymax int)

func (*Board) Cursors

func (b *Board) Cursors() []Pos

func (*Board) DeleteCursor

func (b *Board) DeleteCursor(pos Pos)

func (*Board) Dump

func (b *Board) Dump()

func (*Board) DumpBox

func (b *Board) DumpBox(xmin, xmax, ymin, ymax int, focus Pos)

func (*Board) DumpWithFocus

func (b *Board) DumpWithFocus(focus Pos)

func (*Board) Get

func (b *Board) Get(pos Pos) CellType

func (*Board) GetACursor

func (b *Board) GetACursor() (Pos, bool)

func (*Board) GetWithDefault

func (b *Board) GetWithDefault(pos Pos, def CellType) CellType

func (*Board) InBounds

func (b *Board) InBounds(pos Pos) bool

func (*Board) Score

func (b *Board) Score() (numFlow, numFilled int)

func (*Board) Set

func (b *Board) Set(pos Pos, cell CellType)

func (*Board) ToImage

func (b *Board) ToImage() image.Image

func (*Board) Visit

func (b *Board) Visit(want CellType, visitor func(pos Pos))

type CellType

type CellType int
const (
	TYPE_OPEN CellType = iota
	TYPE_WALL
	TYPE_FLOW
	TYPE_FILLED
	TYPE_SPRING
)

func (CellType) Short

func (c CellType) Short() string

func (CellType) String

func (c CellType) String() string

type InputLine

type InputLine struct {
	Xmin, Xmax int
	Ymin, Ymax int
}

type Pos

type Pos struct {
	X, Y int
}

func PosFromString

func PosFromString(str string) (Pos, error)

func (Pos) Eq

func (p Pos) Eq(s Pos) bool

Jump to

Keyboard shortcuts

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