day_22

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

Documentation

Index

Constants

View Source
const (
	Open rune = '.'
	Wall rune = '#'
)

Variables

This section is empty.

Functions

func P

func P(x, y int) grid.Point

func Part1

func Part1()

func Part2

func Part2()

func PointsBetween

func PointsBetween(p1, p2 grid.Point) []grid.Point

Types

type Board

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

func (*Board) NextPos

func (b *Board) NextPos(p grid.Point, f Face) (grid.Point, rune)

func (*Board) Start

func (b *Board) Start() grid.Point

type Connection

type Connection struct {
	FromPosFace PosFace
	ToPosFace   PosFace
}

type Cube

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

func (*Cube) Connect

func (c *Cube) Connect(from PosFace, to PosFace)

func (*Cube) ConnectRange

func (c *Cube) ConnectRange(fromFace Face, fromP1, fromP2 grid.Point, toFace Face, toP1, toP2 grid.Point)

func (*Cube) NextPos

func (b *Cube) NextPos(p grid.Point, f Face) (grid.Point, Face, rune)

func (*Cube) Start

func (b *Cube) Start() grid.Point

type Face

type Face string
const (
	Right Face = "R"
	Down  Face = "D"
	Left  Face = "L"
	Up    Face = "U"
)

func (Face) Opposite

func (f Face) Opposite() Face

func (Face) Score

func (f Face) Score() int

func (Face) Turn

func (f Face) Turn(t string) Face

type Path

type Path []PathPair

type PathPair

type PathPair struct {
	Moves int
	Turn  string
}

type PosFace

type PosFace struct {
	Pos  grid.Point
	Face Face
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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