solver

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSolverInvalidSignature = errors.New("invalid signature in plugin")
)

Functions

func FromPluginBoth

func FromPluginBoth(p *Plugin, d aoc.Day) (Func, Func, error)

Types

type Func

type Func = func(Input) (Output, error)

func FromPlugin

func FromPlugin(p *Plugin, d aoc.Day, pt aoc.Part) (Func, error)

type Input

type Input = string

type Output

type Output = interface{}

type Plugin

type Plugin = plugin.Plugin

type Result

type Result struct {
	aoc.DatePart
	Attr   ResultAttribute
	Err    error
	Answer Output
}

func (Result) String

func (s Result) String() string

type ResultAttribute

type ResultAttribute struct {
	ResultKind
	B *testing.BenchmarkResult
	T *time.Duration
}

func (ResultAttribute) String

func (r ResultAttribute) String() string

type ResultKind

type ResultKind int
const (
	BenchmarkResult ResultKind = iota
	TimeResult
)

type Solver

type Solver struct {
	aoc.DatePart
	Solver Func
}

func (Solver) Result

func (s Solver) Result(input string, rk ResultKind) Result

func (Solver) Solve

func (s Solver) Solve(in Input) (Output, error)

Jump to

Keyboard shortcuts

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