Skip to content

instilledbee/AdventOfCode2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AdventOfCode2021

Advent of Code 2021 solutions - written in C#/.NET. The aim of this exercise is not to have terse or performant solutions, but rather be an educational repository for others to pick up tips on the logic.

Running the application

  • Build the console application. As this is a .NET 6 app, compiling can be done in Visual Studio 2022. Alternatively, one can download the .NET 6 SDK and build from the command line.
  • The application can be run from the command line with the following parameters: <puzzle number> [<--verbse>] e.g.: AdventOfCode2021.exe 1 --verbose
    • The first argument, <puzzle number> is required and is used to specify which solution to run.
    • The second argument, --verbose is optional. Specifying this argument will show more detailed console output for the running solution. Omit the parameter so that the application only outputs the final answer.
  • Note: This repository intentionally does not include any puzzle inputs. To load your own input files:
    • Create a directory named Inputs in the same directory as the *.exe file
    • Place each input file as <puzzlenumber>.txt, e.g. 1.txt, 42.txt, etc.

Solution Structure

The aim of the solution's structure is to abstract away most of the infrastrctural/cross-cutting concerns so one can easily view the solutions. The project structure is as follows:

  • Solutions - where the puzzle logic is contained. Solutions are implemented as individual classes per "day", and each solution exposes methods to solve the first and second parts of each day.
  • Infrastructure - "glue" code that helps keep the application organized
  • Extensions - helper methods reused across multiple solutions

About

Advent of Code 2021 solutions - written in C#/.NET

Topics

Resources

Stars

Watchers

Forks

Languages