exercises

package
v0.0.0-...-e61498d Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Moves = map[Direction]Point{
	Up:    {X: 0, Y: -1},
	Right: {X: 1, Y: 0},
	Down:  {X: 0, Y: 1},
	Left:  {X: -1, Y: 0},
}

Functions

This section is empty.

Types

type Direction

type Direction int
const (
	Up Direction = iota + 1
	Right
	Down
	Left
)

type Exercise

type Exercise struct {
	common.BaseExercise
}

Exercise for Advent of Code 2023 day 21.

func (Exercise) One

func (e Exercise) One(input string) (any, error)

One returns the answer to the first part of the exercise.

func (Exercise) Two

func (e Exercise) Two(input string) (any, error)

Two returns the answer to the second part of the exercise.

type GardenMap

type GardenMap struct {
	Tiles    map[Point]*Tile
	Start    *Point
	Boundary Point
	Steps    int
}

type Point

type Point util.Point2D

type Tile

type Tile struct {
	Point Point
	Type  TileType
}

type TileType

type TileType rune
const (
	Garden TileType = '.'
	Rock   TileType = '#'
	Start  TileType = 'S'
)

Jump to

Keyboard shortcuts

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