day23

package
v0.0.0-...-9c9a4a3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	N  = "N"
	S  = "S"
	E  = "E"
	W  = "W"
	NE = "NE"
	NW = "NW"
	SE = "SE"
	SW = "SW"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Coordinate

type Coordinate struct {
	Row int
	Col int
}

func (Coordinate) Add

func (c Coordinate) Add(other Coordinate) Coordinate

type Elf

type Elf struct {
	Position Coordinate
	// contains filtered or unexported fields
}

func (*Elf) AcceptProposal

func (elf *Elf) AcceptProposal()

func (*Elf) EndRound

func (elf *Elf) EndRound()

func (*Elf) Propose

func (elf *Elf) Propose(grove *Grove) (bool, Coordinate)

type Grove

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

func NewGrove

func NewGrove(elfs []Elf) *Grove

func (*Grove) EmptySpaces

func (g *Grove) EmptySpaces() int

func (*Grove) Occupied

func (g *Grove) Occupied(pos Coordinate) bool

func (*Grove) Print

func (g *Grove) Print()

func (*Grove) RunAll

func (g *Grove) RunAll() int

func (*Grove) RunRounds

func (g *Grove) RunRounds(rounds int)

type Parser

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

func NewParser

func NewParser(s Scanner) Parser

func (*Parser) Parse

func (p *Parser) Parse() []Elf

type Scanner

type Scanner interface {
	Scan() bool
	Text() string
}

Jump to

Keyboard shortcuts

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