This repo contains my own (dmachaj) personal solutions to various Advent of Code challenges. This repo is public but it is not licensed for any sort of reuse or redistribution.
Advent of Code is a time-based challenge so the code is on the sloppy side and is not a reflection of what I consider to be production-quality code. Similarly the build and verification scripts are super quick&dirty but are fast and effective enough for this usage.
The code for this project is C++ and uses the MSVC compiler. There are helper scripts to build and verify a given day's challenge.
- Begin with a "Visual Studio Dev Tools" command prompt
cdto the directory that you are trying to build. For examplecd 2023\Day01...\..\build.cmdto build that program..\..\verify.cmd Part1to check the correctness of the first problem for that day...\..\verify.cmd Part2to check the second problem.
When you are done you can run clean-build-results.cmd in the root of the repo to clean up any leftovers.
The C# code in this project uses .net8 (or newer). To build simply run dotnet:
- Begin with a command-prompt in the appropriate directory (e.g.
cd 2021\Day01). dotnet buildto compile..\..\verify.cmd Part1to check the first problem...\..\verify.cmd Part2to check the second problem.
After completion you can run clean-build-results.cmd from the root of the repo to clean up.
- Add
#include <fstream> - Add
#include <istream> - Add to top of function
std::ifstream file(R"(Part1\unique.in)"); - Replace input loop
while (std::getline(file, input))
- Add
#include <iomanip> std::cerr << std::setw(3) << std::setfill(' ') << NUMBER