diff options
Diffstat (limited to 'Day.cs')
-rw-r--r-- | Day.cs | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/Day.cs b/Day.cs deleted file mode 100644 index eb3ef49..0000000 --- a/Day.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using aoc2019.lib; - -namespace aoc2019 -{ - public abstract class Day - { - protected Day(int dayNumber, string puzzleName) - { - DayNumber = dayNumber; - PuzzleName = puzzleName; - } - - public int DayNumber { get; } - public string PuzzleName { get; } - - protected virtual IEnumerable<string> Input => - File.ReadLines(FileName); - - protected string FileName => - Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"input/day{DayNumber,2:00}.in"); - - public void AllParts(bool verbose = true) - { - Console.WriteLine($"Day {DayNumber,2}: {PuzzleName}"); - var s = Stopwatch.StartNew(); - var part1 = Part1(); - s.Stop(); - Console.Write($"Part1: {part1,-15} "); - Console.WriteLine(verbose ? $"{s.ScaleMilliseconds()}ms elapsed" : ""); - - s.Reset(); - - s.Start(); - var part2 = Part2(); - s.Stop(); - Console.Write($"Part2: {part2,-15} "); - Console.WriteLine(verbose ? $"{s.ScaleMilliseconds()}ms elapsed" : ""); - - Console.WriteLine(); - } - - protected abstract string Part1(); - protected abstract string Part2(); - } -} \ No newline at end of file |