Refactor Day08 and Day09 to update collection types and method names for improved consistency and clarity

This commit is contained in:
Sebastian Lindemeier
2025-12-09 11:41:41 +01:00
parent 3360b6cfba
commit 411672d8c3
2 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -54,12 +54,12 @@ public class Day09 : IPuzzleSolver<long>
private IEnumerable<CoordinatePair> GetAllPossibleRectanglesAsPairs(Coordinate[] redTiles)
{
return Combinations(redTiles).Select(x => AsMinMax(x.a, x.b));
return Combinations(redTiles).Select(x => AsPair(x.a, x.b));
}
private CoordinatePair[] GetBordersAsPairs(Coordinate[] redTiles)
{
return GetBorders(redTiles).Select(x => AsMinMax(x.a, x.b)).ToArray();
return GetBorders(redTiles).Select(x => AsPair(x.a, x.b)).ToArray();
}
private bool IsRectangleInsideBorders(CoordinatePair[] borders, CoordinatePair rectangle)
@@ -67,7 +67,7 @@ public class Day09 : IPuzzleSolver<long>
return !borders.Any(border => RectangleCrossesBorder(rectangle, border));
}
private CoordinatePair AsMinMax(Coordinate a, Coordinate b)
private CoordinatePair AsPair(Coordinate a, Coordinate b)
{
return (Math.Min(a.x, b.x), Math.Min(a.y, b.y), Math.Max(a.x, b.x), Math.Max(a.y, b.y));
}