lib

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: GPL-2.0, GPL-3.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

View Source
const YEAR = 2020

Variables

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 Apply

func Apply(f func(int) int, c <-chan int) <-chan int

func CSVParser

func CSVParser(input string) []string

CSVParser ...

func ContextWithSignals

func ContextWithSignals(ctx context.Context) context.Context

func DashParser

func DashParser(input string) []string

DashParser ...

func GetInput

func GetInput(day int, sessionCookie string) (r string, err error)

GetInput returns the puzzle input for the given day.

func InputFloats

func InputFloats(input string, parser func(string) []string) [][]float64

Returns the input as a two-dimensional array of float64.

func InputInts

func InputInts(input string, parser func(string) []string) [][]int

Returns the input as a two-dimensional array of int.

func Max

func Max(a, b int) int

func Min

func Min(a, b int) int

func NumberParser

func NumberParser(input string) []string

NumberParser ...

func ParseInput

func ParseInput(input string, parser func(string) []string) [][]string

Parses each line of the input with the given parser function.

func Reduce

func Reduce(f func(int, int) int, c <-chan int) (r int)

func Sign

func Sign(a int) int

func TrimSpace

func TrimSpace(input []string) (r []string)

Trimmer ...

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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