Solutions for the 2020 Advent of Code
This project makes use of Go 1.15.
go mod download
go test ./...
To run a solution, use the problem name followed by the path to an input file.
For example, to run problem 2a
:
$ go run ./main.go 2 a -i ./challenge/day2/input.txt
Answer: 9633
Took 999.4µs
A generator program is included in gen/problem.go
that makes templates for each day. For
example, go run gen/problem.go 9 a
will generate the following files:
challenge/cmd/importDay9.go
: A "glue" file combining commands for both of the day's problems to simplify wiring up subcommandschallenge/day9/a.go
: The main problem implementation, containing a cobra commanda
and the implementationfunc A(*challenge.Input) int
challenge/day9/a_test.go
: A basic test templatechallenge/day9/b.go
: The main problem implementation, containing a cobra commandb
and the implementationfunc B(*challenge.Input) int
challenge/day9/b_test.go
: A basic test templatechallenge/day9/input.txt
: The challenge input
These solutions are licensed under the MIT License.
See LICENSE for details.