utils

package
v0.0.0-...-22e6c3c Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs[T int | uint | float64](x T) T

func AbsDiff

func AbsDiff[T int | uint | float64](a, b T) T

func CmdSolutionRunner

func CmdSolutionRunner[T any](day int, p1, p2 func(*[]string) T)

func DivMod

func DivMod(n, d int) (int, int)

func EndTimer

func EndTimer(s StartTime)

func FileToLines

func FileToLines(filename string) []string

func GCD

func GCD(a, b int) int

func GetArgs

func GetArgs() (string, int)

func GetFloatsFromString

func GetFloatsFromString(s string, sep string) []float64

func GetIntsFromString

func GetIntsFromString(s string, sep string) []int

func GetIntsFromStrings

func GetIntsFromStrings(los *[]string) []int

func GetMapKeys

func GetMapKeys[M ~map[K]V, K comparable, V any](m M) []K

func GetMapValues

func GetMapValues[M ~map[K]V, K comparable, V any](m M) []V

func KeysByVal

func KeysByVal[M ~map[K]V, K comparable, V comparable](m M, x V) []K

func LCM

func LCM(a, b int) int

func Quadratic

func Quadratic(a, b, c float64) (float64, float64, error)

func RunSolutions

func RunSolutions[T any](day int, p1, p2 func(*[]string) T, f1 string, f2 string, loglevel int)

func WriteAGif

func WriteAGif(images *[]*image.Paletted, delays *[]int, filename string)

func WriteGif

func WriteGif(img *image.Paletted, filename string)

Types

type StartTime

type StartTime struct {
	// contains filtered or unexported fields
}

func StartTimer

func StartTimer(s string) StartTime

Jump to

Keyboard shortcuts

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