aoc

package
v0.0.0-...-9483a1a Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs[T Ordinary](v T) T

func Contains

func Contains[T any](slice []T, equal func(value T) bool) bool

func CountBits

func CountBits[T Ordinary](value T) int

func Max

func Max[T Ordinary](a, b T) T

func Min

func Min[T Ordinary](a, b T) T

func Must

func Must(err error)

func ParseInts

func ParseInts(str string) []int

func ReadAllInput

func ReadAllInput() []string

func ReadAllInputFromFile

func ReadAllInputFromFile(name string) []string

func StrToInt

func StrToInt(str string) int

Types

type Heap

type Heap[T any] struct {
	// contains filtered or unexported fields
}

func NewHeap

func NewHeap[T any](less func(v1, v2 T) bool) Heap[T]

func (*Heap[T]) Len

func (h *Heap[T]) Len() int

func (*Heap[T]) Poll

func (h *Heap[T]) Poll() T

func (*Heap[T]) Pop

func (h *Heap[T]) Pop() T

func (*Heap[T]) Push

func (h *Heap[T]) Push(values ...T)

type Ordinary

type Ordinary interface {
	byte | int
}

type Vector2

type Vector2 struct {
	X int
	Y int
}

func NewVector2

func NewVector2(x, y int) Vector2

func (Vector2) Add

func (v Vector2) Add(av Vector2) Vector2

func (Vector2) Len

func (v Vector2) Len() int

func (Vector2) ManhattanDst

func (v Vector2) ManhattanDst() int

func (Vector2) Mul

func (v Vector2) Mul(scalar int) Vector2

func (Vector2) Norm

func (v Vector2) Norm() Vector2

func (Vector2) RotateLeft

func (v Vector2) RotateLeft() Vector2

func (Vector2) RotateRight

func (v Vector2) RotateRight() Vector2

func (Vector2) Sub

func (v Vector2) Sub(av Vector2) Vector2

Jump to

Keyboard shortcuts

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