solution handling

This commit is contained in:
2025-12-01 12:53:24 -05:00
parent 9fa9f4b683
commit c8401b7b9e

View 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}");
}
}