Skip to content

Commit b7159d8

Browse files
committed
update rocs, remove printing
1 parent 299297a commit b7159d8

File tree

3 files changed

+68
-8
lines changed

3 files changed

+68
-8
lines changed

README.md

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,78 @@
22

33
Some overengineered Python solutions for Advent of Code 2023
44

5+
Quick docker run (same behavior as running the package locally):
6+
57
```
68
docker build -t advent-of-code-python-app .
79
docker run advent-of-code-python-app
810
```
911

12+
Running solutions (recommended)
13+
14+
This project exposes a small CLI entrypoint implemented in `src/advent_of_code/cli.py`.
15+
There are three common ways to run a day's solution:
16+
17+
- Run directly from the repository (no install):
18+
19+
```
20+
PYTHONPATH=src python -m advent_of_code --year 2025 --day 1
21+
```
22+
23+
- Run with the module flag (if you have the package importable):
24+
25+
```
26+
python -m advent_of_code --year 2025 --day 1
27+
```
28+
29+
- Install editable and use the console script (recommended for convenience):
30+
31+
```
32+
pip install -e .
33+
aoc --year 2025 --day 1
34+
```
35+
36+
Notes on invocation
37+
38+
- The CLI expects `--year` and `--day`. The `--day` value accepts either `1` or `01` — the code zero-pads the value to match input filenames.
39+
- Input files live under `inputs/year_<YYYY>/<NN>.dat` where `<NN>` is zero-padded to two digits (e.g. `01.dat`).
40+
- Each day module under `src/advent_of_code/year_<YYYY>/day_<NN>.py` should expose a `main(input_file)` function which the CLI calls.
41+
- 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.
42+
43+
Dependencies and `uv`
44+
45+
- Project dependencies are listed in `pyproject.toml` and `requirements.txt`.
46+
- 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.
47+
48+
Installing dependencies
49+
50+
```
51+
pip install -r requirements.txt
52+
# or for editable install (recommended if you want the `aoc` console script):
53+
pip install -e .
54+
```
55+
56+
Scripts
57+
58+
- `scripts/run_day.py` — a small script that mirrors the CLI behavior but can be invoked directly with Python.
59+
- `scripts/run_all_solutions.py` — discovers and runs available day solutions (skips days without an input file).
60+
61+
### 2025 Progress
62+
63+
| Day | Part 1 | Part 2 |
64+
| :---: | :------: | :------: |
65+
| 01 | ⭐️ | ⭐️ |
66+
| 02 | ⭐️ | ⭐️ |
67+
| 03 | ⭐️ | ⭐️ |
68+
69+
### 2024 Progress
70+
71+
| Day | Part 1 | Part 2 |
72+
| :---: | :------: | :------: |
73+
| 01 | ⭐️ | ⭐️ |
74+
| 02 | ⭐️ | ⭐️ |
75+
| 03 | ⭐️ | ⭐️ |
76+
1077
### 2023 Progress
1178

1279
| Day | Part 1 | Part 2 |
@@ -16,5 +83,4 @@ docker run advent-of-code-python-app
1683
| 03 | ⭐️ | ⭐️ |
1784
| 04 | ⭐️ | ⭐️ |
1885
| 05 | todo | todo |
19-
| 06 | ⭐️ | ⭐️ |
20-
| 07 | todo | todo |
86+
| 06 | ⭐️ | ⭐️ |

src/advent_of_code/year_2025/day_01.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ def points_at_zero_counter(current_position, turn_direction, distance):
3636
full_loops = distance // DIAL_SIZE
3737

3838
partial_loops = 0
39-
print("Case:", current_position, turn_direction, distance)
40-
print(" Full loops:", full_loops)
4139

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

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

64-
print(" Partial loops:", partial_loops)
65-
6661
return full_loops + partial_loops
6762

6863

src/advent_of_code/year_2025/day_03.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def calculate_largest_joltage(battery_bank_as_ints, n_batteries):
3535
start_ix = leftmost_index + 1
3636
batteries_remaining -= 1
3737

38-
print(f"list_of_joltages={list_of_joltages}")
3938
return combine_joltages(list_of_joltages)
4039

4140

0 commit comments

Comments
 (0)