This repository contains my solutions for Advent of code 2021 🎄. All tasks are solved with C# and have unit tests to validate them.
I tried solving all tasks using only .Net 6 without external libraries. You can run any solution from the corresponding test.
I made a point not to share any code between parts one and two. I tried to use new language features and a more functional approach, but with later tasks I wasn't always successful in it.
In project adventofcode-2021 you can find solution algorithms and in adventofcode-2021.Tests you can find tests that run said solutions. I store the first and the second parts in different folders. The same structure applies to both projects.
You can find input data files and input parsers code in adventofcode-2021.Tests project. To use your input data instead of mine, you should update the data file you can find in the same folder as a test runner. For example - data file for the day one part one.
-
Install .Net Core 6.
-
Clone my repository.
-
Inside code folder run in console
dotnet test --filter "DisplayName~Task1_"
Task1_ should be replaced with task number you want to run (to get the task number click on the solution link in the table above).
I implemented each solution the same day it was published and haven't done any refactoring afterward (except minor cleanup and warning fixes), so sometimes the code may be a bit straightforward.