-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
29 lines (19 loc) · 938 Bytes
/
Program.cs
File metadata and controls
29 lines (19 loc) · 938 Bytes
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
using AoC2022;
using AoC2022.Days;
using Spectre.Console;
var results = new List<Result>()
.Concat(await IAocResults.RunAndGetResults(Day01.PartOneAndTwo))
.Concat(await IAocResults.RunAndGetResults(Day02.PartOneAndTwo))
.Concat(await IAocResults.RunAndGetResults(Day03.PartOneAndTwo))
.Concat(await IAocResults.RunAndGetResults(Day04.PartOneAndTwo))
.Concat(await IAocResults.RunAndGetResults(Day05.PartOneAndTwo))
.Concat(await IAocResults.RunAndGetResults(Day06.PartOneAndTwo))
.Concat(await IAocResults.RunAndGetResults(Day07.PartOneAndTwo));
var table = new Table();
var centered = (string name) => new TableColumn(name).Centered();
table
.AddColumn(centered("DAY"))
.AddColumn(centered("PART"))
.AddColumn(centered("RESULT"));
results.ToList().ForEach(row => table.AddRow(row.Day.ToString(), row.Part.ToString(), row.Value.ToString() ?? 0.ToString()));
AnsiConsole.Write(table);