Documentation ¶
Index ¶
- func Abs[T constraints.Integer | constraints.Float](x T) T
- func Count[T any](in []T, countFn func(T) bool) int
- func GCD[T constraints.Signed | constraints.Unsigned](a, b T) T
- func InputFromWebsite(day string) string
- func Int(value string) int64
- func LCM[T constraints.Signed | constraints.Unsigned](integers ...T) T
- func Max[T constraints.Ordered](in ...T) T
- func Min[T constraints.Ordered](in ...T) T
- func Slice[T any](data string, separator string, convert func(string) T) []T
- func UInt(value string) uint64
- type Coord
- type RuneStack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
func Abs[T constraints.Integer | constraints.Float](x T) T
Abs returns the absolute (non negative) value of the input
func Count ¶
Count returns an int of the number if values in the input slice that return true when evaluated by countFn
func GCD ¶
func GCD[T constraints.Signed | constraints.Unsigned](a, b T) T
greatest common divisor (GCD) via Euclidean algorithm
func InputFromWebsite ¶
InputFromWebsite reads the AOC_SESSION env variable to form the session cookie and then reads the input for the appropriate day. NB says are not zero prefixed so day one is just "1"
TODO oauth login via github etc. so I don't have to steal the session cookie from my browser
func LCM ¶
func LCM[T constraints.Signed | constraints.Unsigned](integers ...T) T
find Least Common Multiple (LCM) via GCD
func Max ¶
func Max[T constraints.Ordered](in ...T) T
Max returns the maximum value in the input slice
func Min ¶
func Min[T constraints.Ordered](in ...T) T
Min returns the minimum value in the input slice
Types ¶
Click to show internal directories.
Click to hide internal directories.