C++ solutions for Advent of Code challenges.
.
├── 2015/
│ └── 01/
│ ├── CMakeLists.txt
│ └── solution.cpp
├── inputs/ # Git submodule for private inputs
│ └── 2015/
│ └── 01/
│ └── input.txt
├── main.cpp # Main entry point
└── CMakeLists.txt # Top-level build configuration
- CMake 3.20 or higher
- C++20 compatible compiler (GCC 10+, Clang 12+)
- Python 3 (for the new_day.py script)
cmake -B build
cmake --build build./build/aoc <year> <day>Example:
./build/aoc 2015 1Use the provided script to automatically create a new day:
./new_day.py <year> <day>Example:
./new_day.py 2015 2This will:
- Create the directory structure (
YYYY/DD/) - Generate
CMakeLists.txtwith proper configuration - Create
solution.cppfrom template - Create placeholder input file (
inputs/YYYY/DD/input.txt)
Then simply:
- Add your puzzle input to
inputs/YYYY/DD/input.txt - Implement the solution in
YYYY/DD/solution.cpp - Rebuild:
cmake --build build - Run:
./build/aoc YYYY DD
The build system automatically discovers all YYYY/DD/ directories, so no manual CMake configuration needed!
Input files are kept in a separate git submodule to maintain privacy.
See inputs/README.md for instructions on setting up the submodule.