Documentation ¶
Overview ¶
Package aocgo provides functions to get your Advent of Code puzzle inputs in a non-intrusive way.
Index ¶
- func GetInputAsByteArray() []byte
- func GetInputAsCharMatrix() [][]string
- func GetInputAsLineArray() []string
- func GetInputAsString() string
- func RunSolve[In InputData, Out AnswerData](title string, solver Solver[In, Out], inputData In)
- func RunTest[In InputData, Out AnswerData](title string, solver Solver[In, Out], inputData In, expected Out)
- type AnswerData
- type InputData
- type Solver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInputAsByteArray ¶
func GetInputAsByteArray() []byte
GetInputAsByteArray will return the user's puzzle input, as determined by the file's working directory, as an array of bytes.
func GetInputAsCharMatrix ¶ added in v1.2.0
func GetInputAsCharMatrix() [][]string
GetInputAsCharMatrix will return the user's puzzle input, as determined by the file's working directory, as a 2D matrix, split on newlines and then by every character
func GetInputAsLineArray ¶
func GetInputAsLineArray() []string
GetInputAsLineArray will return the user's puzzle input, as determined by the file's working directory, as an array of strings, split on newline.
func GetInputAsString ¶
func GetInputAsString() string
GetInputAsString will return the user's puzzle input, as determined by the file's working directory, as a single string.
func RunSolve ¶ added in v1.2.0
func RunSolve[In InputData, Out AnswerData](title string, solver Solver[In, Out], inputData In)
RunSolve will attempt to run the input function with the input data. It will print out information about the function run in a pretty table.
func RunTest ¶ added in v1.2.0
func RunTest[In InputData, Out AnswerData](title string, solver Solver[In, Out], inputData In, expected Out)
RunTest will run a given function with the given input, and compare it against a known output. The result will print with a color based on if your function returns the same result as was expected.
Types ¶
type AnswerData ¶ added in v1.2.0
AnswerData interface is for any form that the puzzle answer can be output as
type InputData ¶ added in v1.2.0
InputData interface is a Generic wrapper around the possible forms you can get puzzle input data in
type Solver ¶ added in v1.2.0
type Solver[input InputData, answer AnswerData] func(input) answer
Func is a function that will take in
Directories ¶
Path | Synopsis |
---|---|
Package aocutils is a collection of commonly used functions that might be helpful for Advent of Code solving.
|
Package aocutils is a collection of commonly used functions that might be helpful for Advent of Code solving. |
cmd
|
|
aocli
`Aocli` allows you to interface with Advent of Code workflows without leaving your terminal.
|
`Aocli` allows you to interface with Advent of Code workflows without leaving your terminal. |
internal
|
|