Skip to content

thejan14/adventofcode2023

Repository files navigation

visitors

Advent of Code 2023

Welcome to my Advent of Code 2023 contribution! The solutions are written in C++23 using CMake, Ninja and the MSVC compiler on Windows. When writing the solutions code I primarily aim for readability but try to always keep performance considerations in mind (thought the latter strongly depends on how much time I can spend). Happy reading!

What is Advent of Code?

Advent of code is made by Eric Wastl.

[It is] an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.

For more information see about Advent of Code.

Running the solutions

For running the code you need Visual Studio 2022 with the Desktop development with C++ workload installed. Open the repository folder in Visual Studio and navigate to the "CMake Targets View" in the Solution explorer:

grafik

Right click the target you want to run and choose "Debug":

Screenshot 2023-12-02 132742

You can also compile and run the code on Linux. Make sure you have the latest version of CMake and gcc installed (tested with CMake 3.27.7 and gcc 13.1.0). Note that gcc must be installed to /usr/bin/gcc. Then run the following command in the repository folder:

cmake -B./out/build --preset="x64-debug-linux" .

This will prepare your build files. To build the C++ code run:

cmake --build ".\out\build"

Now you can run the solutions by navigating to the respective build folder:

(cd ./out/build/dayXX/ && ./dayXXpartY)