Documentation
¶
Index ¶
- Constants
- Variables
- func AbsI(x int) int
- func Atoi(s string) int
- func ResultF64(f float64) string
- func ResultI(i int) string
- func ResultS(s []string) string
- func ResultSI(s []int) string
- type Cache
- type Client
- type Counter
- type CounterKey
- type DefaultCache
- type DefaultClient
- type Input
- type Point
- type Runner
- type Solver
- type String
- func (s String) At(i int) byte
- func (s String) Atoi() int
- func (s String) From(i int) String
- func (s String) Split() []String
- func (s String) SplitAtoi() []int
- func (s String) SplitOn(d string) []String
- func (s String) SplitOnAtoi(d string) []int
- func (s String) SplitOnS(d string) []string
- func (s String) SplitS() []string
Constants ¶
View Source
const URL = "https://adventofcode.com"
Variables ¶
View Source
var SPACE_REGEX = regexp.MustCompile(`\s+`)
Functions ¶
Types ¶
type Counter ¶ added in v0.4.0
type Counter struct {
// contains filtered or unexported fields
}
func NewCounter ¶ added in v0.4.0
func (Counter) GetKeys ¶ added in v0.4.0
func (c Counter) GetKeys() []CounterKey
type CounterKey ¶ added in v0.4.0
type DefaultCache ¶
type DefaultCache struct{}
func NewDefaultCache ¶
func NewDefaultCache() DefaultCache
func (DefaultCache) StoreInput ¶ added in v0.1.3
type DefaultClient ¶
type DefaultClient struct {
// contains filtered or unexported fields
}
func NewDefaultClient ¶
func NewDefaultClient(session string) (DefaultClient, error)
func (DefaultClient) SendSolution ¶
type Input ¶
type Input struct {
// contains filtered or unexported fields
}
func (Input) SingleLine ¶ added in v0.1.3
func (Input) ToIntSlice ¶
func (Input) ToStringSlice ¶
type Point ¶ added in v0.1.3
func (Point) MoveNorth ¶ added in v1.4.0
MoveNorth return a new point one step to the north.
It supposes a grid where X goes from west to east, and Y from north to south.
func (Point) RotateLeftZ ¶ added in v0.1.3
func (Point) RotateRightZ ¶ added in v0.1.3
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func NewDefaultRunner ¶
Return a new Runner object with default cache and client.
This is the main constructor you should use.
func NewRunner ¶
Return a new Runner.
Unless you want to inject specific implementation for the cache and the client you should use NewDefaultRunner.
type Solver ¶
type Solver interface {
Day1p1(Input) string
Day1p2(Input) string
Day2p1(Input) string
Day2p2(Input) string
Day3p1(Input) string
Day3p2(Input) string
Day4p1(Input) string
Day4p2(Input) string
Day5p1(Input) string
Day5p2(Input) string
Day6p1(Input) string
Day6p2(Input) string
Day7p1(Input) string
Day7p2(Input) string
Day8p1(Input) string
Day8p2(Input) string
Day9p1(Input) string
Day9p2(Input) string
Day10p1(Input) string
Day10p2(Input) string
Day11p1(Input) string
Day11p2(Input) string
Day12p1(Input) string
Day12p2(Input) string
Day13p1(Input) string
Day13p2(Input) string
Day14p1(Input) string
Day14p2(Input) string
Day15p1(Input) string
Day15p2(Input) string
Day16p1(Input) string
Day16p2(Input) string
Day17p1(Input) string
Day17p2(Input) string
Day18p1(Input) string
Day18p2(Input) string
Day19p1(Input) string
Day19p2(Input) string
Day20p1(Input) string
Day20p2(Input) string
Day21p1(Input) string
Day21p2(Input) string
Day22p1(Input) string
Day22p2(Input) string
Day23p1(Input) string
Day23p2(Input) string
Day24p1(Input) string
Day24p2(Input) string
Day25p1(Input) string
Day25p2(Input) string
}
An object implementing the solutions for all days.
A day method receives an Input object, and must return a string. If a day method returns an empty string, it will consider the solution is not implemented yet and it will not send it.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.