Add benchmark support using -b
This commit is contained in:
@@ -153,7 +153,7 @@ public class Day13 : Day
|
||||
{
|
||||
public override int Number => 13;
|
||||
public override string Name => "Distress Signal";
|
||||
public override void RunPart1()
|
||||
public override void RunPart1(bool display = true)
|
||||
{
|
||||
var pairs = ParsePacketPairs();
|
||||
|
||||
@@ -169,10 +169,13 @@ public class Day13 : Day
|
||||
}
|
||||
}
|
||||
|
||||
AnsiConsole.MarkupLine($"[green]Right order pair indices sum: [yellow]{sum}[/][/]");
|
||||
if (display)
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[green]Right order pair indices sum: [yellow]{sum}[/][/]");
|
||||
}
|
||||
}
|
||||
|
||||
public override void RunPart2()
|
||||
public override void RunPart2(bool display = true)
|
||||
{
|
||||
var packets = ParsePackets();
|
||||
|
||||
@@ -186,7 +189,11 @@ public class Day13 : Day
|
||||
|
||||
var firstDividerIndex = orderedPackets.IndexOf(firstDivider) + 1;
|
||||
var lastDividerIndex = orderedPackets.IndexOf(lastDivider) + 1;
|
||||
AnsiConsole.MarkupLine($"[green]Decoder key is: [yellow]{firstDividerIndex * lastDividerIndex}[/][/]");
|
||||
|
||||
if (display)
|
||||
{
|
||||
AnsiConsole.MarkupLine($"[green]Decoder key is: [yellow]{firstDividerIndex * lastDividerIndex}[/][/]");
|
||||
}
|
||||
}
|
||||
private static PacketElement ReadElement(ref ReadOnlySpan<char> packet)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user