Advent of Code template based on AoCHelper project.
It allows you to focus on solving AoC puzzles while providing you with some performance stats.
Problem example:
using AoCHelper; using System.Threading.Tasks; namespace AdventOfCode; public class Day_01 : BaseDay { public override ValueTask<string> Solve_1() => new("Solution 1"); public override ValueTask<string> Solve_2() => new("Solution 2"); }
Output example:
DayXX
or Day_XX
naming convention and implementing AoCHelper.BaseDay
.Inputs/
dir, following XX.txt
convention.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<Day_XX>();
→ 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<SolverConfiguration>
to any of those methods (availabe options described here):
Solver.SolveLast(opt => opt.ClearConsole = false);
→ solves only the last day providing a custom configuration.
Solver.SolveAll(opt => { opt.ShowConstructorElapsedTime = true; opt.ShowTotalElapsedTimePerDay = true; opt.ElapsedTimeFormatSpecifier = "F3"; });
solves all the days providing a custom configuration.
Check AoCHelper README file for detailed information about how to override the default file naming and location conventions of your problem classes and input files.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4