solution handling
This commit is contained in:
18
AdventOfCode2025/AdventSolution.cs
Normal file
18
AdventOfCode2025/AdventSolution.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace AdventOfCode2025;
|
||||
|
||||
public interface IAdventSolution
|
||||
{
|
||||
public AdventSolution Solve(string input);
|
||||
}
|
||||
|
||||
public record struct AdventSolution(string PartOne, string PartTwo);
|
||||
|
||||
public class AdventSolver<T> where T : IAdventSolution, new()
|
||||
{
|
||||
public static void Solve(string input, int day, string title)
|
||||
{
|
||||
var solver = new T();
|
||||
var solution = solver.Solve(input);
|
||||
Console.WriteLine($"Day {day}: {title}\nPart 1: {solution.PartOne}\nPart 2: {solution.PartTwo}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user