This repository contains my solutions to Advent of Code challenges, organized by year.
advent_of_code/
├── 2024/ # Solutions for Advent of Code 2024
│ ├── src/ # Solution files (day_1.py, day_2.py, ...)
│ └── inputs/ # Input files for each day
├── 2025/ # Solutions for Advent of Code 2025
│ ├── src/ # Solution files
│ └── inputs/ # Input files
├── aoc.py # Main CLI script to run solutions
├── setup_day.py # Script to scaffold a new day
└── pyproject.toml # Project dependencies and configuration
This project uses PDM for dependency management.
-
Install PDM (if not already installed):
pip install pdm
-
Install project dependencies:
pdm install
Use the aoc command to run solutions:
pdm run aoc --year <YEAR> --day <DAY> --part <PART> [--test] [--debug]Arguments:
--year: The year of the challenge (e.g., 2024, 2025)--day: The day number (1-25)--part: The part number (1 or 2)--test: (Optional) Run with test input instead of the full input--debug: (Optional) Enable debug logging
Examples:
# Run part 1 of day 1 for 2025
pdm run aoc --year 2025 --day 1 --part 1
# Run part 2 with test input
pdm run aoc --year 2025 --day 1 --part 2 --test
# Run with debug logging
pdm run aoc --year 2025 --day 1 --part 1 --debugUse the setup_day.py script to scaffold a new day:
pdm run python setup_day.py --year <YEAR> --day <DAY>This will create:
- A solution template file at
<YEAR>/src/day_<DAY>.py - An empty input file at
<YEAR>/inputs/day_<DAY>_input.txt - An empty test input file at
<YEAR>/inputs/day_<DAY>_input_test.txt
Example:
pdm run python setup_day.py --year 2025 --day 4MIT
