pkg

package
v0.0.0-...-a8cd84c Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs(i int) int

func Bin2Dec

func Bin2Dec(binary string) int

func ChangeToFloatSlice

func ChangeToFloatSlice(ar []int) []float64

func ChangeToIntSlice

func ChangeToIntSlice(ar []float64) []int

func CheckAndDownloadFile

func CheckAndDownloadFile(filename, url string)

CheckAndDownloadFile checks if we have the input file for the day and downloads it if it is not available

func Contains

func Contains(n int, s *[]int) bool

func Equal

func Equal(a *[]int, b *[]int) bool

func GCD

func GCD(a, b int) int

func Hex2Bits

func Hex2Bits(hex string) []uint64

func LCM

func LCM(a, b int) int

func LineScanner

func LineScanner(path string) *bufio.Scanner

func Max

func Max(values ...int) int

func Min

func Min(values ...int) int

func Multiply

func Multiply(values ...int) int

func MustAtoi

func MustAtoi(s string) int

func Read

func Read(scanner *bufio.Scanner) (string, bool)

func RuneScanner

func RuneScanner(path string) *bufio.Scanner

func ShiftSliceLeft

func ShiftSliceLeft(s *[]int, num int)

func ShiftSliceRight

func ShiftSliceRight(s *[]int, num int)

func SliceContainsString

func SliceContainsString(s []string, e string) bool

func SortString

func SortString(s string) string

func Sum

func Sum(values ...int) int

func ToFloatSlice

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

func ToIntSlice

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

func ToIntSliceCharacter

func ToIntSliceCharacter(s string) []int

func WordScanner

func WordScanner(path string) *bufio.Scanner

Types

type Input

type Input string

Input holds the puzzle inputs as a string

func GetInputFromSlice

func GetInputFromSlice(numbers []int) *Input

func ReadInput

func ReadInput(fileName string) (puzzle Input, err error)

ReadInput reads the input file into a string

func (*Input) AsIntSlice

func (i *Input) AsIntSlice() []int

AsIntSlice returns the Input as a slice of ints

func (*Input) AsStringSlice

func (i *Input) AsStringSlice() []string

AsStringSlice returns the Input as a slice of strings

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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