Skip to content

tdody/advent_of_code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code Solutions

Advent of Code

This repository contains my solutions to Advent of Code challenges, organized by year.

Project Structure

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

Setup

This project uses PDM for dependency management.

  1. Install PDM (if not already installed):

    pip install pdm
  2. Install project dependencies:

    pdm install

Usage

Running a Solution

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 --debug

Setting Up a New Day

Use 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 4

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages