Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Harness ¶
type Harness[T any, U comparable] struct { // contains filtered or unexported fields }
Harness manages running each days' challenge code, including parsing the input before calling solve, and managing test expectations from examples.
func New ¶
func New[T any, U comparable](solve func(T) U, opts ...HarnessOpt[T, U]) *Harness[T, U]
New returns a new Harness. At minimum a solve function and some inputs are required.
func (*Harness[T, U]) Benchmark ¶
Benchmark is a utility to run a benchmark on solve using the main input.
type HarnessOpt ¶
type HarnessOpt[T any, U comparable] func(harness *Harness[T, U])
HarnessOpt modifies the Harness when initialising.
func WithNoSubmit ¶
func WithNoSubmit[T any, U comparable]() HarnessOpt[T, U]
func WithPreProcessor ¶
func WithPreProcessor[T any, U comparable](preProcessor PreProcessor[T]) HarnessOpt[T, U]
WithPreProcessor explicitly sets the PreProcessor to be used.
func WithSilence ¶
func WithSilence[T any, U comparable]() HarnessOpt[T, U]
type PreProcessor ¶
PreProcessor is a function that process the input data before passing to the solve function.
func DoubleSection ¶
func DoubleSection() PreProcessor[[2]string]
func DoubleSectionLines ¶
func DoubleSectionLines() PreProcessor[[2][]string]
func Ints ¶
func Ints() PreProcessor[[][]int]
Ints process the input to a slice of ints for each line
func SplitNewlines ¶
func SplitNewlines() PreProcessor[[]string]
SplitNewlines is the default processing that splits the input on newlines
func SplitSequence ¶
func SplitSequence(seq string) PreProcessor[[]string]
SplitSequence trims and splits the input on the seq string sequence