File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 11// Package declares common interface for puzzle solutions and functionality for register and run them.
2- package solutions
3-
2+ //
43// Each solution should implement `Solver` interface, be implemented udnder separate package and contain `init()`
54// function that will register that solution in list of all solvers.
6-
5+ //
6+ // Example:
7+ //
78// type solver struct {
89// name string
910// }
1011//
1112// func init() {
12- // const puzzleName = "day01"
13+ // puzzleName, err := solutions.MakeName("2019", "day01")
14+ // if err != nil {
15+ // panic(err)
16+ // }
1317// puzzles.Register(puzzleName, solver{
1418// name: puzzleName,
1519// })
1620// }
17-
21+ //
1822// Then to register solution in the list of all solutions: make a blank import of package with puzzle solution
1923// at main.go
2024//
21- // _ "github.com/oleg-balunenko/advent-of-code/puzzles/solutions/day01"
25+ // import _ "github.com/oleg-balunenko/advent-of-code/puzzles/solutions/day01"
26+ package solutions
You can’t perform that action at this time.
0 commit comments