using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; namespace AdventOfCode.Contracts { public abstract class Day { public abstract int Year { get; } public abstract int DayNumber { get; } private List Output { get; set; } = new List(); protected void Print(string part, object output) => Output.Add($"{Year} Day {DayNumber} Part {part}: {output}"); protected void Print(string part, long elapsed, object output) => Output.Add($"{Year} Day {DayNumber} Part {part}: {output} {Environment.NewLine}Time: {elapsed}"); public void Write() => Console.WriteLine(string.Join(Environment.NewLine, Output)); public void Execute(bool bigBoi) { string[] input = File.ReadAllLines($"../../../Input/{Year}/day{DayNumber}.txt"); Part1(input); Part2(input); if (bigBoi) { BigBoi(File.ReadAllLines($"../../../Input/{Year}/BigBoi/day{DayNumber}.txt")); } } public abstract void Part1(string[] input); public abstract void Part2(string[] input); public abstract void BigBoi(string[] input); } }