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
Run as module
cd ./python
python -m 2024.puzzle_2024_01 ../puzzles
python -m 2024.puzzle_2024_02 ../puzzles
python -m 2024.puzzle_2024_03 ../puzzles
python -m 2024.puzzle_2024_04 ../puzzles
python -m 2024.puzzle_2024_05 ../puzzles
python -m 2024.puzzle_2024_06 ../puzzles
python -m 2024.puzzle_2024_07 ../puzzles
python -m 2024.puzzle_2024_08 ../puzzles
or include path, to use utils
cd ./python
export PYTHONPATH=$(pwd)
python ./2024/puzzle_2024_01.py ../puzzles
python ./2024/puzzle_2024_02.py ../puzzles
python ./2024/puzzle_2024_03.py ../puzzles
python ./2024/puzzle_2024_04.py ../puzzles
Download puzzle description using aoc-cli
current_year=$(date +%Y)
for day in {01..25}
do
mkdir -p ./puzzles/$current_year/$day/
aoc download -y $current_year -d $day -o -P -p ./puzzles/$current_year/$day/puzzle.md
aoc download -y $current_year -d $day -o -I -i ./puzzles/$current_year/$day/input.txt
done
pre-commit run --files ./puzzles/**/*