fruitpicker

package
v0.0.0-...-1bcda63 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoadStringOverride = ""

Functions

func ConvertStringsToInts

func ConvertStringsToInts(s []string) []int

ConvertStringsToInts - converts input to ints if appropriate

func Largest

func Largest[T Number](in []T) (T, int)

func Load

func Load[T any](convert func(string) T, grouped bool) []T

func Map

func Map[T, S any](t []T, f func(T) S) []S

func ReadGroupedInput

func ReadGroupedInput() []string

ReadGroupedInput returns groups of input separated by empty lines

func ReadInput

func ReadInput() []string

ReadInput returns lines of input separated by new lines

func Reduce

func Reduce[T, S any](t []T, accumulator S, f func(T, S, int) S) S

func Select

func Select[T any](in []T, f func(i T) bool) (out []T)

func Smallest

func Smallest[T Number](in []T) (T, int)

func SumList

func SumList[T Number](in []T) (total T)

add up a list

Types

type Number

type Number interface {
	constraints.Float | constraints.Integer
}

Jump to

Keyboard shortcuts

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