advent

package
v0.0.0-...-91d2b32 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: MIT Imports: 9 Imported by: 2

Documentation

Overview

Package advent contains

Index

Constants

This section is empty.

Variables

View Source
var DataFolder = "data"

Functions

func ByteToInt

func ByteToInt(b byte) int

ByteToInt converts a single digit as a byte into a real int e.g '1' -> 1

func LoadData

func LoadData(file string) ([]string, error)

LoadData attempts to complete load a data file and returns the data in a slice containing one element per newline delimited line.

func LoadIntData

func LoadIntData(file string) ([]int, error)

func LoadIntDataSliceOfSlices

func LoadIntDataSliceOfSlices(file string) ([][]int, error)

LoadIntDataSliceOfSlices loads blank line delimited chunks of newline delimited ints into grouped slices.

func LoadIntSliceData

func LoadIntSliceData(fileName string) ([]int, error)

LoadIntSliceData loads a set of ints, comma delimited, from a single line

func OpenFile

func OpenFile(fileName string) (*os.File, error)

func Run

func Run(number int8, day Day)

Types

type Day

type Day interface {
	Answer() (int, int, error)
	Name() string
}

Day defines the interface for a day of an advent challenge

Jump to

Keyboard shortcuts

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