Documentation ¶
Index ¶
- Variables
- func Apply(f func(int) int, c <-chan int) <-chan int
- func CSVParser(input string) []string
- func ContextWithSignals(ctx context.Context) context.Context
- func DashParser(input string) []string
- func Euclid(p, q image.Point) float64
- func GetInput(year, day int, sessionCookie string) (r string, err error)
- func InputFloats(input string, parser func(string) []string) [][]float64
- func InputInts(input string, parser func(string) []string) [][]int
- func Max(a, b int) int
- func Min(a, b int) int
- func Neighbors4(p image.Point) (r []image.Point)
- func Neighbors8(p image.Point) (r []image.Point)
- func NumberParser(input string) []string
- func ParseInput(input string, parser func(string) []string) [][]string
- func Reduce(f func(int, int) int, c <-chan int) (r int)
- func Sign(a int) int
- func Taxi(p, q image.Point) float64
- func TrimSpace(input []string) (r []string)
- func UDLR(p, q image.Point) int
- type Dim
Constants ¶
This section is empty.
Variables ¶
View Source
var Diagnals = []image.Point{ image.Point{1, 1}, image.Point{1, -1}, image.Point{-1, -1}, image.Point{-1, 1}, }
View Source
var Directions = []image.Point{ image.Point{0, 1}, image.Point{0, -1}, image.Point{-1, 0}, image.Point{1, 0}, }
View Source
var Inputs []string
All puzzle inputs stored as an array of UTF-8 strings.
View Source
var NumberRE = regexp.MustCompile(`[-+]?\d*\.?\d*`)
Functions ¶
func InputFloats ¶
Returns the input as a two-dimensional array of float64.
func Neighbors4 ¶ added in v1.6.8
Returns the neighbors up, down, left, and right of P.
func Neighbors8 ¶ added in v1.9.23
Returns the neighbors UDLR of P and the diagnals.
func ParseInput ¶
Parses each line of the input with the given parser function.
Types ¶
Click to show internal directories.
Click to hide internal directories.