Solutions to the Christmas themed Advent-of-Code challenges.
My aim this year is to do as many as I can in Python, and then in Go.
How I run the code, works on my machine (until I start trying to solve the problems π₯΄).
# creates dirs at go/day{day}, python/src/day{day}, python/test/day{day}
# from the templates in each of those repos
# then fetches input and sticks it where I want it (next to the solutions)
./helpers/new_day.sh 2020 {day}
# attempt to destroy anything created above ;)
./helpers/cleanup.sh {day}
# run all tests
./helpers/test.sh
These need to be run from inside /go
.
// get answers - from the days dir (e.g go/day1/)
go run main.go
// run tests - also from the dir of the day
go test
// run tests - run all tests recursively
go test ./...
I use a Miniconda Python env.
Setting up with the local module imports can be a bit awkward.
This answer was helpful for me getting past pesky ModuleNotFound
errors!
These commands should be able to run from anywhere inside the repo. π€
# get answers
python python/src/day{day}/main.py
# run tests (individual day)
python python/test/day{day}/test_main.py
# run tests (whole suite)
pytest
-
Template