Add benchmark support using -b
This commit is contained in:
15
Days/Day8.cs
15
Days/Day8.cs
@@ -6,7 +6,7 @@ public class Day8 : Day
|
||||
{
|
||||
public override int Number => 8;
|
||||
public override string Name => "Treetop Tree House";
|
||||
public override void RunPart1()
|
||||
public override void RunPart1(bool display = true)
|
||||
{
|
||||
var grid = CreateGrid();
|
||||
|
||||
@@ -92,10 +92,14 @@ public class Day8 : Day
|
||||
}
|
||||
}
|
||||
|
||||
AnsiConsole.MarkupLine($"[green]Total viewable trees: [yellow]{valid.Count}[/][/]");
|
||||
|
||||
if (display)
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[green]Total viewable trees: [yellow]{valid.Count}[/][/]");
|
||||
}
|
||||
}
|
||||
|
||||
public override void RunPart2()
|
||||
public override void RunPart2(bool display = true)
|
||||
{
|
||||
var grid = CreateGrid();
|
||||
|
||||
@@ -116,7 +120,10 @@ public class Day8 : Day
|
||||
}
|
||||
}
|
||||
|
||||
AnsiConsole.MarkupLine($"[green]Max scenic score: [yellow]{maxScenicScore}[/][/]");
|
||||
if (display)
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[green]Max scenic score: [yellow]{maxScenicScore}[/][/]");
|
||||
}
|
||||
}
|
||||
|
||||
private int ComputeScenicScore(int[,] grid, int i, int j, int size)
|
||||
|
||||
Reference in New Issue
Block a user