Add benchmark support using -b
This commit is contained in:
@@ -6,7 +6,7 @@ public class Day10 : Day
|
||||
{
|
||||
public override int Number => 10;
|
||||
public override string Name => "Cathode-Ray Tube";
|
||||
public override void RunPart1()
|
||||
public override void RunPart1(bool display = true)
|
||||
{
|
||||
int cycle = 1;
|
||||
int x = 1;
|
||||
@@ -47,10 +47,13 @@ public class Day10 : Day
|
||||
}
|
||||
}
|
||||
|
||||
AnsiConsole.MarkupLine($"[green]Sum of signal strengths: [yellow]{sum}[/][/]");
|
||||
if (display)
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[green]Sum of signal strengths: [yellow]{sum}[/][/]");
|
||||
}
|
||||
}
|
||||
|
||||
public override void RunPart2()
|
||||
public override void RunPart2(bool display = true)
|
||||
{
|
||||
// Setup the CRT
|
||||
const char litPixel = '#';
|
||||
@@ -122,7 +125,10 @@ public class Day10 : Day
|
||||
}
|
||||
|
||||
// Print the CRT
|
||||
AnsiConsole.Write(crtCanvas);
|
||||
if (display)
|
||||
{
|
||||
AnsiConsole.Write(crtCanvas);
|
||||
}
|
||||
}
|
||||
|
||||
#region Input
|
||||
|
||||
Reference in New Issue
Block a user