puzzles2022

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

Documentation

Index

Constants

View Source
const ChamberWidth = 7

Variables

View Source
var Solutions = map[int]func(string) error{
	1:  Day01,
	2:  Day02,
	3:  Day03,
	4:  Day04,
	5:  Day05,
	6:  Day06,
	7:  Day07,
	8:  Day08,
	9:  Day09,
	10: Day10,
	11: Day11,
	12: Day12,
	13: Day13,
	14: Day14,
	15: Day15,
	16: Day16,
	17: Day17,
	18: Day18,
	20: Day20,
	21: Day21,
	22: Day22,
	23: Day23,
}

Solutions points to the implementations of 2022's puzzles.

Functions

func Day01

func Day01(file string) error

func Day02

func Day02(file string) error

func Day03

func Day03(file string) error

func Day04

func Day04(file string) error

func Day05

func Day05(file string) error

func Day06

func Day06(file string) error

func Day07

func Day07(file string) error

func Day08

func Day08(file string) error

func Day09

func Day09(file string) error

func Day10

func Day10(file string) error

func Day11

func Day11(file string) error

func Day12

func Day12(file string) error

func Day13

func Day13(file string) error

func Day14

func Day14(file string) error

func Day15

func Day15(file string) error

func Day16

func Day16(file string) error

func Day17

func Day17(file string) error

func Day18

func Day18(file string) error

func Day20

func Day20(file string) error

func Day21

func Day21(file string) error

func Day22

func Day22(file string) error

func Day23

func Day23(file string) error

func SizeOfTheSmallestDirectoryThatIfDeletedWouldFreeUpEnoughSpaceOnTheFilesystemToRunTheUpdate

func SizeOfTheSmallestDirectoryThatIfDeletedWouldFreeUpEnoughSpaceOnTheFilesystemToRunTheUpdate(dir *Dir, needsToFree int) int

Types

type CPU

type CPU struct {
	X int

	CRT CRT
	// contains filtered or unexported fields
}

func NewCPU

func NewCPU() *CPU

type CRT

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

type Coord

type Coord struct {
	X int
	Y int
}

func (*Coord) Follow

func (c *Coord) Follow(other Coord)

func (*Coord) Move

func (c *Coord) Move(dx, dy int)

func (*Coord) Touching

func (c *Coord) Touching(other Coord) bool

type Dir

type Dir struct {
	Dirs  map[string]*Dir
	Files map[string]int
	Name  string
	Size  int
}

func NewDir

func NewDir(name string) *Dir

type Outcome

type Outcome int
const (
	Lose Outcome = iota
	Draw
	Win
)

type Range

type Range struct {
	Lower int
	Upper int
}

func NewRange

func NewRange(r string) Range

func (Range) Contains

func (r Range) Contains(r2 Range) bool

func (Range) Overlaps

func (r Range) Overlaps(r2 Range) bool

type Shape

type Shape int
const (
	Rock Shape = iota
	Paper
	Scissors
)

type Stack

type Stack []string

func (*Stack) Pop

func (s *Stack) Pop() string

func (*Stack) PopMultiple

func (s *Stack) PopMultiple(n int) []string

func (*Stack) Prepend

func (s *Stack) Prepend(b string)

func (*Stack) Push

func (s *Stack) Push(b string)

func (*Stack) PushMultiple

func (s *Stack) PushMultiple(m []string)

func (*Stack) Top

func (s *Stack) Top() string

Directories

Path Synopsis
day11
day12
day13
day14
day15
day16
day17

Jump to

Keyboard shortcuts

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