ben
/
aoc
1
0
Fork 0

fix eols
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Ben Harris 2023-12-01 13:25:21 -05:00
parent 260e10ec9e
commit 8f84143d73
5 changed files with 27 additions and 27 deletions

View File

@ -7,7 +7,7 @@ public sealed partial class Day16() : Day(2015, 16, "Aunt Sue")
{
[GeneratedRegex(@": \d\d")]
private static partial Regex TwoDigitsRegex();
public override void ProcessInput()
{
}

View File

@ -35,10 +35,10 @@ public sealed partial class Day07() : Day(2016, 7, "Internet Protocol Version 7"
private static bool SupportsSsl(string input)
{
foreach (var ip in BracketsRegex().Split(input))
foreach (var aba in CheckAba(ip))
foreach (var m in InsideBracketsRegex().Matches(input).Cast<Match>())
if (m.Value.Contains($"{aba[1]}{aba[0]}{aba[1]}"))
return true;
foreach (var aba in CheckAba(ip))
foreach (var m in InsideBracketsRegex().Matches(input).Cast<Match>())
if (m.Value.Contains($"{aba[1]}{aba[0]}{aba[1]}"))
return true;
return false;
}

View File

@ -10,7 +10,7 @@ public sealed class Day14() : Day(2020, 14, "Docking Data")
}
private static readonly char[] SquareBrackets = ['[', ']'];
private static readonly char[] BracketsAndEquals = [..SquareBrackets, '='];
private static readonly char[] BracketsAndEquals = [.. SquareBrackets, '='];
public override object Part1()
{

View File

@ -21,27 +21,27 @@ public sealed class Day18() : Day(2020, 18, "Operation Order")
postfixNotation.Append(c);
}
else switch (c)
{
case '(':
postfixStack.Push(c);
break;
case ')':
{
while (postfixStack.Count > 0 && postfixStack.Peek() != '(')
postfixNotation.Append(postfixStack.Pop());
postfixStack.TryPop(out _);
break;
}
default:
{
while (postfixStack.Count > 0 && precedence(c) <= precedence(postfixStack.Peek()))
postfixNotation.Append(postfixStack.Pop());
{
case '(':
postfixStack.Push(c);
break;
}
}
case ')':
{
while (postfixStack.Count > 0 && postfixStack.Peek() != '(')
postfixNotation.Append(postfixStack.Pop());
postfixStack.TryPop(out _);
break;
}
default:
{
while (postfixStack.Count > 0 && precedence(c) <= precedence(postfixStack.Peek()))
postfixNotation.Append(postfixStack.Pop());
postfixStack.Push(c);
break;
}
}
while (postfixStack.Count > 0)
postfixNotation.Append(postfixStack.Pop());

View File

@ -7,7 +7,7 @@ public sealed partial class Day20() : Day(2020, 20, "Jurassic Jigsaw")
{
[GeneratedRegex("(?<=#.{77})#.{4}#{2}.{4}#{2}.{4}#{3}(?=.{77}#.{2}#.{2}#.{2}#.{2}#.{2}#)")]
private static partial Regex MonsterRegex();
public override void ProcessInput()
{
}
@ -255,5 +255,5 @@ public sealed partial class Day20() : Day(2020, 20, "Jurassic Jigsaw")
piece.Sides.Value.Concat(piece.Sides.Value.Select(s => new string(s.Reverse().ToArray()))).ToHashSet();
}
}