Solutions for Advent of Code 2025 in C++.
- Clone repository:
git clone --recurse-submodules https://github.com/sanraith/aoc2025- or
git submodule initandgit submodule updateafter git clone.
- or
- If not using CLion, make sure to set the vcpkg correctly. To use it from submodule, set:
-DCMAKE_TOOLCHAIN_FILE=..\external\vcpkg\scripts\buildsystems\vcpkg.cmake - To trigger bootstrapping of vcpkg, try building project using CMake or run
./external/vcpkg/bootstrap-vcpkg.shon macOS/Linux.\external\vcpkg\bootstrap-vcpkg.baton Windows
Scaffolding instructions are provided for the copilot agent in .github/agents/Scaffolder.agent.md
to auto-generate empty boilerplate code for each day. To use, ask in agent mode to scaffold day 1.
While scaffolding, the agent tries to run scaffold.cpp to download puzzle description and input,
and tries to open the current puzzle description in the user's browser.
To allow this to work without user interaction, whitelist the following commands to auto-approve:
- Opening adventofcode.com:
/^(Start-Process|open) 'https:\/\/adventofcode\.com\/\d+\/day\/\d+'$/
- Running scaffolder in debug mode:
/^\.[\\\/]cmake-build-debug-(win|mac)[\\\/]scaffold(\.exe)?( -y \d+ -d \d+)?$/
- Run a specific day:
aoc2025 -y 2025 -d 1oraoc2025 --year 2025 --day 1 - Run the last implemented day:
aoc2025 -loraoc2025 --last - Run all implemented days:
aoc2025 -aoraoc2025 --all - Show help:
aoc2025 -horaoc2025 --help
Configuration file:
- The runner automatically looks for
aoc2025.config.jsonin the current directory or nearest parent directory. - Example config (see
src/util/AocConfig.hfor details):
{
"eventYear": 2025,
"copyResultToClipboard": true,
"sessionCookie": "your_session_cookie_here"
}- Add package:
./external/vcpkg/vcpkg add port PACKAGE_NAME - Include package in CMakeLists.txt:
find_package(PACKAGE_NAME CONFIG REQUIRED) target_link_libraries(aoc2025lib PRIVATE PACKAGE_NAME::PACKAGE_NAME)
This repository does follow the automation guidelines on the /r/adventofcode community wiki. Specifically:
- Outbound calls are only triggered manually, by
scaffold.cpp. - All successful web requests are cached locally in
.cache/byCachedAocDataLoader - If you suspect your input is corrupted, you can manually request a fresh copy by deleting the corresponding file in
first from
input/, then.cache/if the problem persists. - The User-Agent header in
CachedAocDataLoaderis set to me (https://github.com/sanraith/aoc2025 by [email protected]) since I maintain this repository.