Add benchmark support using -b
This commit is contained in:
14
Days/Day9.cs
14
Days/Day9.cs
@@ -7,7 +7,7 @@ public class Day9 : Day
|
||||
public override int Number => 9;
|
||||
public override string Name => "Rope Bridge";
|
||||
|
||||
public override void RunPart1()
|
||||
public override void RunPart1(bool display = true)
|
||||
{
|
||||
// Start
|
||||
(int x, int y) start = (0, 0);
|
||||
@@ -49,10 +49,13 @@ public class Day9 : Day
|
||||
}
|
||||
}
|
||||
|
||||
AnsiConsole.MarkupLine($"[green]The tail visited [yellow]{tailVisitedPositions.Count}[/] unique positions[/]");
|
||||
if (display)
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[green]The tail visited [yellow]{tailVisitedPositions.Count}[/] unique positions[/]");
|
||||
}
|
||||
}
|
||||
|
||||
public override void RunPart2()
|
||||
public override void RunPart2(bool display = true)
|
||||
{
|
||||
const int tailSegments = 9;
|
||||
|
||||
@@ -130,7 +133,10 @@ public class Day9 : Day
|
||||
}
|
||||
}
|
||||
|
||||
AnsiConsole.MarkupLine($"[green]The tail visited [yellow]{tailVisitedPositions.Count}[/] unique positions[/]");
|
||||
if (display)
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[green]The tail visited [yellow]{tailVisitedPositions.Count}[/] unique positions[/]");
|
||||
}
|
||||
}
|
||||
|
||||
#region Input
|
||||
|
||||
Reference in New Issue
Block a user