-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
32 lines (30 loc) · 1020 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using AdventOfCode.Common;
using BenchmarkDotNet.Running;
switch (args.Length)
{
case 0:
PrintDay(Solver.GetMostRecentDay());
break;
case 1 when args[0].Contains("all", StringComparison.CurrentCultureIgnoreCase):
Solver.GetDays().ForEach(PrintDay);
break;
case 1 when args[0].Contains("bench", StringComparison.CurrentCultureIgnoreCase):
BenchmarkRunner.Run<BenchmarkLatest>();
break;
case 2:
PrintDay(Solver.GetDay(int.Parse(args[0]), int.Parse(args[1])));
break;
}
void PrintDay(BaseDay day)
{
Console.WriteLine("┌────────────────┐");
Console.WriteLine($"│ Day {day.Day.ToString("D2")} of {day.Year} │");
Console.WriteLine("└────────────────┘");
try
{
Console.WriteLine($"- Part 1: {day.Part1()}");
Console.WriteLine($"- Part 2: {day.Part2()}");
Console.WriteLine();
}
catch (NotImplementedException) {}
}