Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eduherminio/AdventOfCode.Template
Advent of Code C# (.NET 8) template. Based on AoCHelper (https://github.com/eduherminio/AoCHelper)
https://github.com/eduherminio/AdventOfCode.Template
advent-of-code advent-of-code-2020 advent-of-code-2021 advent-of-code-2022 advent-of-code-2023 adventocode adventofcode2020 adventofcode2021 adventofcode2022 adventofcode2023 aoc aoc2020 aoc2021 aoc2022 aoc2023 competitive-programming
Last synced: about 2 months ago
JSON representation
Advent of Code C# (.NET 8) template. Based on AoCHelper (https://github.com/eduherminio/AoCHelper)
- Host: GitHub
- URL: https://github.com/eduherminio/AdventOfCode.Template
- Owner: eduherminio
- License: mit
- Created: 2020-11-28T19:08:20.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-08T15:59:04.000Z (about 1 year ago)
- Last Synced: 2024-08-03T18:13:09.813Z (5 months ago)
- Topics: advent-of-code, advent-of-code-2020, advent-of-code-2021, advent-of-code-2022, advent-of-code-2023, adventocode, adventofcode2020, adventofcode2021, adventofcode2022, adventofcode2023, aoc, aoc2020, aoc2021, aoc2022, aoc2023, competitive-programming
- Language: C#
- Homepage: https://adventofcode.com
- Size: 21.5 KB
- Stars: 37
- Watchers: 3
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-advent-of-code - eduherminio/AdventOfCode.Template
README
# AdventOfCode.Template
![CI](https://github.com/eduherminio/AdventOfCode.Template/workflows/CI/badge.svg)
Advent of Code template based on [AoCHelper](https://github.com/eduherminio/AoCHelper) project.
It allows you to focus on solving AoC puzzles while providing you with some performance stats.
Problem example:
```csharp
using AoCHelper;
using System.Threading.Tasks;namespace AdventOfCode;
public class Day_01 : BaseDay
{
public override ValueTask Solve_1() => new("Solution 1");public override ValueTask Solve_2() => new("Solution 2");
}```
Output example:
![aochelper](https://user-images.githubusercontent.com/11148519/142051856-16d9d5bf-885c-44cd-94ae-6f678bcbc04f.gif)
## Basic usage
- Create one class per advent day, following `DayXX` or `Day_XX` naming convention and implementing `AoCHelper.BaseDay`.
- Place input files under `Inputs/` dir, following `XX.txt` convention.
- Read the input content from `InputFilePath` and solve the puzzle by implementing `Solve_1()` and `Solve_2()`!**By default, only your last problem will be solved when running the project**. You can change that by behavior by modifying `Program.cs`.
Invoking **different methods**:
- `Solver.SolveAll();` → solves all the days.
- `Solver.SolveLast();` → solves only the last day.
- `Solver.Solve();` → solves only day `XX`.
- `Solver.Solve(new uint[] { XX, YY });` → solves only days `XX` and `YY`.
- `Solver.Solve(new [] { typeof(Day_XX), typeof(Day_YY) });` → same as above.
Providing a **custom `Action`** to any of those methods ([availabe options described here](https://github.com/eduherminio/AoCHelper#customization)):
- `Solver.SolveLast(opt => opt.ClearConsole = false);` → solves only the last day providing a custom configuration.
-
```csharp
Solver.SolveAll(opt =>
{
opt.ShowConstructorElapsedTime = true;
opt.ShowTotalElapsedTimePerDay = true;
opt.ElapsedTimeFormatSpecifier = "F3";
});
```
solves all the days providing a custom configuration.## Advanced usage
Check [AoCHelper README file](https://github.com/eduherminio/AoCHelper#advanced-usage) for detailed information about how to override the default file naming and location conventions of your problem classes and input files.