You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Advent of Code](https://adventofcode.com) template for .NET contenders, focus on the puzzle, let it take care the rest
3
+
**A ready-to-go **Advent of Code** template for .NET contenders.**
4
+
**Focus on solving the puzzle; we handle the boilerplate, input, and testing.**
4
5
5
-
> After gaining yours, consider leaving a small ⭐ to this project too!
6
+
This template's core strength is its foundation in **xUnit test projects**, which
7
+
provides two massive advantages for complex AoC puzzles: **seamless debugging** and native support for **Test-Driven Development (TDD)**.
6
8
7
-
---
9
+
Here are the features offered by the template:
8
10
9
-
## Advantages
11
+
***Automatic Input Retrieval** (local file or remotely fetches your input for a given day)
12
+
***Modeling/Parsing Tests** to allow you to model the problem as you want
13
+
***Example Tests** using provided examples and expected results to ensure your solution satisfies it
14
+
***Conditional Test Skipping** focus only on the parts you're currently working on
15
+
* Pre-configured **[.NET CI](.github/workflows/dotnet.yml)** to ensure all puzzles are valid
10
16
11
-
In order to solve your puzzle, you might need the debugger from time to time, especially as the puzzles become harder.
17
+
> If this template helps you earn your stars, consider leaving one on this repository
18
+
> too! ⭐
12
19
13
-
This template is built around test projects, in order to take advatage of the debugging possibilities and TDD if you want to.
20
+
## Usage & Setup
14
21
15
-
Here are also a bunch of features offered by the template:
22
+
This template provides two core components: the **`Solver`** (for logic) and the
23
+
**`TestEngine`** (for verification).
16
24
17
-
- Retrieval of the puzzle input localy or remotely
18
-
- Testing of your modelization if you would like to
19
-
- Testing of the puzzle examples
20
-
- Conditionnaly skip the tests of a puzzle if wanted
25
+
**Setup:** To begin a new year, simply create a new **`xUnit`** project and add a
26
+
reference to the **`AdventOfCode.Commons`** library.
21
27
22
-
## Usage
28
+
> If you want to jump straight to the code, check out the
29
+
> [demo project](src/AdventOfCode.Usage).
23
30
24
-
This template exposes two classes: a `Solver` and a `TestEngine`.
25
-
The [.NET CI](.github/workflows/dotnet.yml) is also preconfigured to ensure that all your tests are valid.
31
+
### Solving a New Puzzle
26
32
27
-
To get started with a new year, just create a new `xUnit` project and add a reference to the `AdventOfCode.Commons` project to it.
33
+
Create a new solver by inheriting the generic `Solver<TInput, TResult>` class,
34
+
where `TInput` is your parsed data model and `TResult` is the expected result type.
28
35
29
-
> If you want to jump straight to the code for the usage, check the [demo project](src/AdventOfCode.Usage)
36
+
Your `Solver` requires you to implement three core methods:
30
37
31
-
### Solving a new puzzle
38
+
1.**`ParseInput`**: Convert raw `IEnumerable<string>` input lines into your strongly-typed `TInput` model.
39
+
2.**`PartOne`**: Implement the logic for the first part of the puzzle.
40
+
3.**`PartTwo`**: Implement the logic for the second part of the puzzle.
32
41
33
-
When working a new day, create a new `Solver` by inheriting the `Solver<TInput, TResult>` class,
34
-
with `TInput` being the type of the input you will be working with and `TResult` the type of the result you are expecting.
35
-
36
-
You will then have to implement three different logics:
37
-
38
-
1.**The parsing of the input** in which you will have to convert the raw data from the file you are reading into the `TInput`
39
-
you will be expecting afterwards
40
-
2.**The logic for the first part of the puzzle**
41
-
3.**The logic for the second part of the puzzle**
42
-
43
-
For 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:
0 commit comments