aoc

package
v0.0.0-...-3f7a4de Latest Latest
Warning

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

Go to latest
Published: Dec 25, 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 LastItem

func LastItem[T any](slice []T) T

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 RemoveLastItem

func RemoveLastItem[T any](slice *[]T) T

func StrToInt

func StrToInt(str string) int

Types

type Ordinary

type Ordinary interface {
	byte | int | int16
}

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) Norm

func (v Vector2) Norm() Vector2

func (Vector2) RotateLeft

func (v Vector2) RotateLeft() Vector2

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

func (Vector2) RotateRight

func (v Vector2) RotateRight() Vector2

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

func (Vector2) Sub

func (v Vector2) Sub(av Vector2) Vector2

type Vector3

type Vector3 struct {
	X, Y, Z int
}

func NewVector3

func NewVector3(x, y, z int) Vector3

func (Vector3) Add

func (v Vector3) Add(av Vector3) Vector3

Jump to

Keyboard shortcuts

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