aoc

package
v0.0.0-...-6f94a63 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2023 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 Number](a T) T

func CountBits

func CountBits[T IntNumber](value T) int

func MapKeys

func MapKeys[K comparable, V any](m map[K]V) []K

func Mod

func Mod[T IntNumber](a, b T) T

func Must

func Must(err error)

func ReadAllInput

func ReadAllInput() []string

func ReadAllInputFromFile

func ReadAllInputFromFile(name string) []string

func StrToInt

func StrToInt(str string) int

func StrToInts

func StrToInts(str string) []int

Types

type IntNumber

type IntNumber interface {
	~int | ~int64 | ~uint64
}

type Number

type Number interface {
	IntNumber
}

type Queue

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

func (*Queue[T]) Pop

func (q *Queue[T]) Pop() T

func (*Queue[T]) Push

func (q *Queue[T]) Push(v T)

func (*Queue[T]) Size

func (q *Queue[T]) Size() int

type Vector2

type Vector2[T IntNumber] struct {
	X T
	Y T
}

func NewVector2

func NewVector2[T Number](x, y T) Vector2[T]

func (Vector2[T]) Add

func (v Vector2[T]) Add(av Vector2[T]) Vector2[T]

func (Vector2[T]) Mul

func (v Vector2[T]) Mul(scalar T) Vector2[T]

func (Vector2[T]) RotateLeft

func (v Vector2[T]) RotateLeft() Vector2[T]

RotateLeft rotates the vector to the left (left-handed system)

func (Vector2[T]) RotateRight

func (v Vector2[T]) RotateRight() Vector2[T]

RotateRight rotates the vector to the right (left-handed system)

type Vector3

type Vector3[T IntNumber] struct {
	X T
	Y T
	Z T
}

func NewVector3

func NewVector3[T Number](x, y, z T) Vector3[T]

func (Vector3[T]) Add

func (v Vector3[T]) Add(av Vector3[T]) Vector3[T]

func (Vector3[T]) ManhattanLen

func (v Vector3[T]) ManhattanLen() T

func (Vector3[T]) Mul

func (v Vector3[T]) Mul(scalar T) Vector3[T]

Jump to

Keyboard shortcuts

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