The real challenge is writing good code - quickly, without hating how it turns out.
NOTE: Everyone's data will be different, while the scripts should work for anyone, you'll need to adjust the input.txt
file content of each day if you want to use it for yourself. Know that my input files always have an extra blank line at the end from my editor automatically adding it on save and so in my solutions I discard the last line of the input data.
Install
# Install locally
just install
Usage
Setting Up
Run the following script to setup a new day's folder and file structure, unit tests, and to retrieve your input data (make sure not to run the script until the prompt unlocks for the day). Before running the script, you will need to get the session ID for Advent of Code, they usually last ~30 days. Store this in an .env
file in this project under the ADVENT_OF_CODE_SESSION_ID
env var.
# 1st param is the year, 2nd param is the day
./setup_day.sh 2022 4
Running Challenges
Each day you will get a prompt containing two parts. You get more points the more parts you answer correctly and the faster you do so.
Run a script for a particular day, the output should be the answer(s) you can plug into the Advent of Code daily challenge.
venv/bin/python adventofcode/_2022/day1/challenge.py
Development
# Get a comprehensive list of development tools
just --list
Friends to Keep an Eye On
Advent of Code has the nice side effect of being a competition. Here are a few friends and other noteworthy repos to keep an eye on. There are TONS of things one can learn by studying different approaches to the same problem.