diff options
author | Ben Harris <ben@tilde.team> | 2020-12-16 18:06:36 -0500 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2020-12-16 18:06:36 -0500 |
commit | cb10768fa14c4b6ec19d050e13a0c3e00c152874 (patch) | |
tree | 2da56b45700f5dd1bde994cbeae04f18424a17c3 /Day.cs | |
parent | 837527d487c7e232b36dd87c95a15b7852f2e057 (diff) |
move project to subdirectory and add unit testing
day 13 is removed from the test so it doesn't take 4 years
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 |