About: Software Engineer | Full Stack Developer | Coffee Lover
Location:
France
Joined:
Nov 5, 2017
A small .NET template to back you up
Publish Date: Dec 3 '22
5 0
As usual, for December, the Advent of Code challenge has once again started this year.
I've been trying to do doing it for quite some time now, always in C#, and always have had to type the same code:
The parser for the input file
The solution for the first puzzle
The test for the example
The test for the solution
The solution for the second puzzle
The test for the example
The test for the solution
It may not be much, but it results in either an inconsistent way of solving the puzzles or in a lot of redundancy in the code for each day.
To spare some time (or at least spare some of yours), I created a small GitHub template repository so that you can quickly get started on the implementation on this year's puzzles and not on the boilerplate to do so:
To test your logic against the example and find your solution, inherit from TestEngine
The Solver
The solver is the place where you can specify where your input is, how and to what you want it to be parsed, and the logic to solve the first and second part of the puzzle.
Let's see its usage with an example:
If the first part of the puzzle is "Given a list of integers, find the greatest one" and the second one "Now find the sum of them", we can do the following: