How npatel221/advent-of-code works
This repository contains C++23 Advent of Code solutions, with separate executable workflows for Day 1’s safe-dial puzzle and Day 2’s invalid product-ID puzzle. Each accepts an input-file path, reads and parses puzzle input, runs its domain logic, and prints two answers. Shared file-reading code supports both workflows. The graph follows relationships visible in the sampled entry points and source index; it omits uncertain internal calls where implementation excerpts do not establish them.
Main entry points: day1/main.cpp Day 1 runner · day2/main.cpp Day 2 runner · FileUtils.cpp File reader · Command.cpp Command parser
Components 11
Shared input
- File reader
2025/common/FileUtils.cpp
Day 1 safe
- Day 1 runner
2025/day1/main.cpp - Command parser
2025/day1/Command.cpp - Safe dial
2025/day1/Safe.cpp - Day 1 passwords
2025/day1/main.cpp
Day 2 IDs
- Day 2 runner
2025/day2/main.cpp - Range parser
2025/day2/Range.cpp - ID validator
2025/day2/ProductIdValidator.cpp - Invalid-ID sums
2025/day2/main.cpp
Other components
- Puzzle solver
- Input file
Connections 12
- Puzzle solver → Day 1 runner: runs with path
2025/day1/main.cpp - Puzzle solver → Day 2 runner: runs with path
2025/day2/main.cpp - Day 1 runner → File reader: reads input
2025/day1/main.cpp - Input file → File reader: provides contents
2025/common/FileUtils.cpp - Day 1 runner → Command parser: parses commands
2025/day1/main.cpp - Day 1 runner → Safe dial: applies rotations
2025/day1/main.cpp - Day 1 runner → Day 1 passwords: prints answers
2025/day1/main.cpp - Day 2 runner → File reader: reads input
2025/day2/main.cpp - Input file → File reader: provides contents
2025/common/FileUtils.cpp - Day 2 runner → Range parser: parses ranges
2025/day2/main.cpp - Day 2 runner → ID validator: calculates sums
2025/day2/main.cpp - Day 2 runner → Invalid-ID sums: prints answers
2025/day2/main.cpp