solutions

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package solutions registers solutions of puzzles.

Each solution should implement `Solver` interface, be implemented under separate package and contain `init()` function that will register that solution in list of all solvers.

Example:

type solver struct {
	name string
}

func init() {
	puzzleName, err := solutions.MakeName("2019", "day01")
	if err != nil {
		panic(err)
	}
	puzzles.Register(puzzleName, solver{
	name: puzzleName,
	})
}

Then to register solution in the list of all solutions: make a blank import of package with puzzle solution at register.go

import  _ "github.com/obalunenko/advent-of-code/puzzles/solutions/day01"

And then blank import solutions package at main.go to register all solutions

import _ "github.com/obalunenko/advent-of-code/puzzles/solutions

Directories

Path Synopsis
2015
2016
2017
2018
2019
day01
Package day01 solves https://adventofcode.com/2019/day/1
Package day01 solves https://adventofcode.com/2019/day/1
day02
Package day02 solves https://adventofcode.com/2019/day/2
Package day02 solves https://adventofcode.com/2019/day/2
day03
Package day03 solves https://adventofcode.com/2019/day/3
Package day03 solves https://adventofcode.com/2019/day/3
day04
Package day04 solves https://adventofcode.com/2019/day/4
Package day04 solves https://adventofcode.com/2019/day/4
2020

Jump to

Keyboard shortcuts

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