Skip to content

My solutions to Advent of Code 2020, in Go and Python. πŸŽ…πŸŽ„β˜ƒοΈ

Notifications You must be signed in to change notification settings

jcockbain/advent-of-code-2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ„ advent-of-code-2020 πŸŽ„

Go Solutions Python Solutions

Summary

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.

Running the code

How I run the code, works on my machine (until I start trying to solve the problems πŸ₯΄).

Helpers

# 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

Go

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 ./...

Python

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

Days

About

My solutions to Advent of Code 2020, in Go and Python. πŸŽ…πŸŽ„β˜ƒοΈ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published