aoc

package module
v0.0.0-...-05b2ddf Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 6 Imported by: 0

README ¶

🎄 advent of code 🎅

Documentation ¶

Index ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

func Abs ¶

func Abs(i int64) int64

func Between ¶

func Between(min, max int64) func(int64) bool

func CantorPair ¶

func CantorPair(a, b int64) int64

func CantorTuple ¶

func CantorTuple(p []int64) int64

func Capture ¶

func Capture(r *regexp.Regexp, s string) map[string]string

func Combinations ¶

func Combinations(n, r int) [][]int

func EachLine ¶

func EachLine(input string, fn func(string)) error

func MustParse ¶

func MustParse(s string) int64

func Or ¶

func Or(f, g func(int64) bool) func(int64) bool

func Profile ¶

func Profile() (func(), error)

func Scanner ¶

func Scanner(input string, fn func(*bufio.Scanner)) error

func ZN ¶

func ZN(i int64) int64

Types ¶

type Grid ¶

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

func NewGrid ¶

func NewGrid() *Grid

func (*Grid) Col ¶

func (h *Grid) Col(x int64) []interface{}

func (*Grid) Count ¶

func (h *Grid) Count() int64

func (*Grid) Each ¶

func (h *Grid) Each(fn func(interface{}))

func (*Grid) EachCol ¶

func (h *Grid) EachCol(fn func([]interface{}))

func (*Grid) EachLine ¶

func (h *Grid) EachLine(fn func([]interface{}))

func (*Grid) EachSparse ¶

func (h *Grid) EachSparse(fn func(Point, interface{}))

func (*Grid) Grid ¶

func (h *Grid) Grid() [][]interface{}

func (*Grid) Height ¶

func (h *Grid) Height() int64

func (*Grid) Neighbours ¶

func (h *Grid) Neighbours(p Point) []Point

func (*Grid) Read ¶

func (h *Grid) Read(x, y int64) interface{}

func (*Grid) Row ¶

func (h *Grid) Row(y int64) []interface{}

func (*Grid) Width ¶

func (h *Grid) Width() int64

func (*Grid) Write ¶

func (h *Grid) Write(x, y int64, i interface{})

type GridND ¶

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

func NewGridND ¶

func NewGridND(n int64) *GridND

func (*GridND) EachSparse ¶

func (g *GridND) EachSparse(fn func(PointND, interface{}))

func (*GridND) Read ¶

func (g *GridND) Read(p PointND) interface{}

func (*GridND) Remove ¶

func (g *GridND) Remove(point PointND)

func (*GridND) Size ¶

func (g *GridND) Size() int

func (*GridND) Write ¶

func (g *GridND) Write(point PointND, el interface{})

type Point ¶

type Point struct {
	X int64
	Y int64
}

type PointND ¶

type PointND []int64

func NeighboursND ¶

func NeighboursND(point PointND) []PointND

func (PointND) Add ¶

func (p PointND) Add(o PointND) PointND

func (PointND) Equal ¶

func (p PointND) Equal(o PointND) bool

func (PointND) Key ¶

func (p PointND) Key() interface{}

type Set ¶

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

func Intersection ¶

func Intersection(sets ...*Set) *Set

func NewSet ¶

func NewSet() *Set

func NewSetWithSize ¶

func NewSetWithSize(i int) *Set

func Union ¶

func Union(sets ...*Set) *Set

func (*Set) Add ¶

func (s *Set) Add(e interface{})

func (*Set) Contains ¶

func (s *Set) Contains(e interface{}) bool

func (*Set) Elements ¶

func (s *Set) Elements() []interface{}

func (*Set) Remove ¶

func (s *Set) Remove(e interface{})

func (*Set) Size ¶

func (s *Set) Size() int

Directories ¶

Path Synopsis
2019
01
02
03
04
05
06
07
08
09
10
11
12
13
2020
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
2021
01
02
03
04
05
06
07
08
09
10
11
12
13
14
24
2022
01
02
03
04
05
06
07
08
09
10
11
2023
01
02
03
04
05
06
07
08
09
10
11

Jump to

Keyboard shortcuts

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