day_23

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adjacent

func Adjacent(p grid.Point) []grid.Point

func P

func P(x, y int) grid.Point

func Part1

func Part1()

func Part2

func Part2()

func PosAt

func PosAt(p grid.Point, dir Direction) grid.Point

Types

type Direction

type Direction string
const (
	None Direction = "None"
	N    Direction = "N"
	NE   Direction = "NE"
	E    Direction = "E"
	SE   Direction = "SE"
	S    Direction = "S"
	SW   Direction = "SW"
	W    Direction = "W"
	NW   Direction = "NW"
)

func (Direction) Next

func (dir Direction) Next() Direction

func (Direction) Prev

func (dir Direction) Prev() Direction

type Elve

type Elve struct {
	ID       int
	Pos      grid.Point
	Proposal grid.Point
	Proposed bool
}

type Grid

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

func (*Grid) Bounds

func (g *Grid) Bounds() (min, max grid.Point)

func (*Grid) Move

func (g *Grid) Move() int

func (*Grid) NoElveInEachOf

func (g *Grid) NoElveInEachOf(poss ...grid.Point) bool

func (*Grid) Propose

func (g *Grid) Propose(order []Direction)

func (*Grid) TilesCount

func (g *Grid) TilesCount() (open, occupied int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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