Personal repository for advent of code challenges
1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25
1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25
Create a venv with custom requirements
cd ./python
rm -rf venv
python3.11 -m venv venv
. ./venv/bin/activate
pip install -r requirements.txt
pip install --upgrade pip
Use venv (or any other python env you want)
. ./python/venv/bin/activate
cd ./python && year=2024 && day=14
python -m ${year}.puzzle_${year}_${day} ../puzzles
Run as module
cd ./python
year=$(date -v -11m +%Y)
for day in {01..25}
do
python -m ${year}.puzzle_${year}_${day} ../puzzles
done
or include path, to use utils
cd ./python
export PYTHONPATH=$(pwd)
year=$(date -v -11m +%Y)
for day in {01..25}
do
python ./${year}/puzzle_${year}_${day}.py ../puzzles
done
Download puzzle description and/or input using aoc-cli
Note: to use authenticated requests put your session token in ~/.adventofcode.session
year=$(date -v -11m +%Y)
for day in {01..25}
do
mkdir -p ./puzzles/$year/$day/
aoc download -y $year -d $day -o -P -p ./puzzles/$year/$day/puzzle.md
aoc download -y $year -d $day -o -I -i ./puzzles/$year/$day/input.txt
done
pre-commit run --files ./puzzles/**/*