Advent of Code 2023 solutions, written in C++.
This project uses CMake to build and vcpkg to manage dependencies. Assuming both are installed, you can run:
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-YOUR_PLATFORM-static -B . -S ..
cmake --build . --target allBe sure to change YOUR_PLATFORM to an appropriate triplet, e.g., x64-windows-static.
Markdown versions of each problem are stored as README's for each solution directory (e.g., day1, day2, etc.).
| Day | Title |
|---|---|
| 1 | Trebuchet?! |
| 2 | Cube Conundrum |
| 3 | Gear Ratios |
| 4 | Scratchcards |
| 5 | If You Give A Seed A Fertilizer |
| 6 | Wait For It |
| 7 | Camel Cards |
| 8 | Haunted Wasteland |
| 9 | Mirage Maintenance |
| 10 | Pipe Maze |
| 11 | Cosmic Expansion |
This is a simple python script to generate a new solution directory with templated files.
Example usage:
cd tools
python generate.py -n 1 -t 'Trebuchet?!'Will generate day1 in the repository root (tools/../ by default) with the structure:
day1/
├── include/
│ └── day1.hpp
├── day1_test.cpp
├── main.cpp
└── README.md
Use the --help flag to display all available options.
Tests are disabled by default since GTest is quite heavy and can take awhile to build. You can enable tests with the AOC_BUILD_TESTS option. This may be specified either through the CMake GUI or with the command line option -DAOC_BUILD_TESTS=ON.
If using the CMake extension for VSCode, options can also be set in .vscode/settings.json:
{ "cmake.configureSettings": { "AOC_BUILD_TESTS": true } }