Documentation ¶
Index ¶
- func Abs[T signed](num T) T
- func All[T any](arr []T, cb func(x T, i int) bool) bool
- func GetSignPoint(point image.Point) image.Point
- func ManhattanDistance(a, b image.Point) int
- func Max[T numeric](nums ...T) T
- func Min[T numeric](nums ...T) T
- func ParseInt(str string) int
- func ReadEmptyLineGroups(file string) (content []string)
- func ReadFile(file string) (content string)
- func ReadInts(file string) (content []int)
- func ReadLines(file string) (lines []string)
- func ReadLinesFunc[T comparable](file string, parser func(s string) T) (lines []T)
- func RunSolvers[T any, O any](day Day[T, O])
- type Day
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSignPoint ¶
convert vector into a sign vector ex: {4,0} -> {1,0} and {0,-4} -> {0,-1}
func ManhattanDistance ¶
func ReadEmptyLineGroups ¶
splits and trims file to return empty-new-line-separated groups
func ReadLinesFunc ¶
func ReadLinesFunc[T comparable](file string, parser func(s string) T) (lines []T)
helper for parsing lines of text from a file
func RunSolvers ¶
abstract boilerplate to run solvers for each day
Types ¶
Click to show internal directories.
Click to hide internal directories.