Advent of Code (credits: Eric Wastl) is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as interview prep, company training, university coursework, practice problems, a speed contest, or to challenge each other.
- Language:
- Golang (+ some Python for some days)
- Years:
- 2023
- Go >= 1.21
- Python >= 3.8
- graphviz (optional - for some days which required graph visualization)
go mod download
pip install -r requirements.txt
Warning
My input files are encrypted (cf Run tests section).
Please replace the input file with your own input file, or decrypt mine with git-crypt unlock
.
$ cd {YEAH}/{DAY} && cat {INPUT_FILE} | go run main.go -part={PART}
Example for year 2023, day 1, part 1:
$ cd 2023/01 && cat input.txt | go run main.go -part=1
This will run all solvers against sample data AND input data, and check expected results. The command will also run utils package tests.
Warning
- The tests require all the input data to be present next to each solver, in a file named
input.txt
, e.g.2023/day1/input.txt
- My input files are included in the repo, but they're
git-crypt
encrypted (to be compliant with AoC rules, which forbid to share publicly input files). - For test cases that target input data: the expected results are the ones matching my own input data. If you want to run the tests against your own input data, you'll need to update the expected results in the test cases to match yours (same if the inputs has been rotated). Warning:
$ make test
$ go test ./2023/...
$ make run-all
$ go run cmd/run_all.go -path="." -year=2023
$ make bench
$ go test ./2023/... -bench=.