Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 68 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,78 @@

Some overengineered Python solutions for Advent of Code 2023

Quick docker run (same behavior as running the package locally):

```
docker build -t advent-of-code-python-app .
docker run advent-of-code-python-app
```

Running solutions (recommended)

This project exposes a small CLI entrypoint implemented in `src/advent_of_code/cli.py`.
There are three common ways to run a day's solution:

- Run directly from the repository (no install):

```
PYTHONPATH=src python -m advent_of_code --year 2025 --day 1
```

- Run with the module flag (if you have the package importable):

```
python -m advent_of_code --year 2025 --day 1
```

- Install editable and use the console script (recommended for convenience):

```
pip install -e .
aoc --year 2025 --day 1
```

Notes on invocation

- The CLI expects `--year` and `--day`. The `--day` value accepts either `1` or `01` — the code zero-pads the value to match input filenames.
- Input files live under `inputs/year_<YYYY>/<NN>.dat` where `<NN>` is zero-padded to two digits (e.g. `01.dat`).
- Each day module under `src/advent_of_code/year_<YYYY>/day_<NN>.py` should expose a `main(input_file)` function which the CLI calls.
- If you see "Could not find module" when running the CLI, either install the package (`pip install -e .`) or run with `PYTHONPATH=src` as shown above.

Dependencies and `uv`

- Project dependencies are listed in `pyproject.toml` and `requirements.txt`.
- This repository includes `uv` (version pinned in `requirements.txt` / `pyproject.toml`) as a dependency. Installing the project (or the requirements) will pull `uv` in. The core day-runner CLI (`aoc` / `python -m advent_of_code`) does not require `uv` to run a solution file, but `uv` is available for any tooling or extensions that may use it.

Installing dependencies

```
pip install -r requirements.txt
# or for editable install (recommended if you want the `aoc` console script):
pip install -e .
```

Scripts

- `scripts/run_day.py` — a small script that mirrors the CLI behavior but can be invoked directly with Python.
- `scripts/run_all_solutions.py` — discovers and runs available day solutions (skips days without an input file).

### 2025 Progress

| Day | Part 1 | Part 2 |
| :---: | :------: | :------: |
| 01 | ⭐️ | ⭐️ |
| 02 | ⭐️ | ⭐️ |
| 03 | ⭐️ | ⭐️ |

### 2024 Progress

| Day | Part 1 | Part 2 |
| :---: | :------: | :------: |
| 01 | ⭐️ | ⭐️ |
| 02 | ⭐️ | ⭐️ |
| 03 | ⭐️ | ⭐️ |

### 2023 Progress

| Day | Part 1 | Part 2 |
Expand All @@ -16,5 +83,4 @@ docker run advent-of-code-python-app
| 03 | ⭐️ | ⭐️ |
| 04 | ⭐️ | ⭐️ |
| 05 | todo | todo |
| 06 | ⭐️ | ⭐️ |
| 07 | todo | todo |
| 06 | ⭐️ | ⭐️ |
5 changes: 0 additions & 5 deletions src/advent_of_code/year_2025/day_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ def points_at_zero_counter(current_position, turn_direction, distance):
full_loops = distance // DIAL_SIZE

partial_loops = 0
print("Case:", current_position, turn_direction, distance)
print(" Full loops:", full_loops)

# Check if we passed zero in the remaining distance after full loops
new_position = turn_dial(current_position, turn_direction, distance)
Expand All @@ -58,11 +56,8 @@ def points_at_zero_counter(current_position, turn_direction, distance):

# check if we landed on zero
if current_position != 0 and new_position == 0:
print(" Landed on zero, updating partial loops")
partial_loops += 1

print(" Partial loops:", partial_loops)

return full_loops + partial_loops


Expand Down
1 change: 0 additions & 1 deletion src/advent_of_code/year_2025/day_03.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def calculate_largest_joltage(battery_bank_as_ints, n_batteries):
start_ix = leftmost_index + 1
batteries_remaining -= 1

print(f"list_of_joltages={list_of_joltages}")
return combine_joltages(list_of_joltages)


Expand Down