day10

package
v0.0.0-...-5d524ee Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Day10 = runner.NewDay(10, buildPipeMaze, part1, part2).
	WithExpectedAnswers(6890, 453)

Functions

This section is empty.

Types

type MapTile

type MapTile uint8
const (
	Empty MapTile = iota
	Wall
	Filled
)

func (MapTile) Colour

func (m MapTile) Colour() color.Color

func (MapTile) Rune

func (m MapTile) Rune() rune

func (MapTile) Valid

func (m MapTile) Valid() bool

type Maze

type Maze struct {
	Start  *Tile
	Size   int
	Length int
}

func (Maze) EnclosedArea

func (m Maze) EnclosedArea(ctx *runner.Context) (int, error)

func (Maze) String

func (m Maze) String() string

type Tile

type Tile struct {
	X, Y  int
	North *Tile
	East  *Tile
	South *Tile
	West  *Tile
}

func (*Tile) Next

func (t *Tile) Next(prev *Tile) *Tile

Next returns the next tile in the maze, or nil if there is no next tile The prev tile is used to prevent backtracking, if no prev tile is provided then a direction will be chosen at random

func (*Tile) String

func (t *Tile) String() string

Jump to

Keyboard shortcuts

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