Refactor Day04 and Day09 to rename methods and variables for improved clarity and update Day09 tests with additional input file and test case
This commit is contained in:
+2
-3
@@ -55,13 +55,12 @@ public class Day04 : IPuzzleSolver<long>
|
||||
private HashSet<Coordinate> GetRollCoordinates(IEnumerable<string> paperrollGrid)
|
||||
{
|
||||
var coordinates = paperrollGrid
|
||||
.Index()
|
||||
.SelectMany(indexedLine => GetCoordinates(indexedLine.Item, indexedLine.Index))
|
||||
.SelectMany((line, xIndex) => GetRollCoordinates(line, xIndex))
|
||||
.ToHashSet();
|
||||
return coordinates;
|
||||
}
|
||||
|
||||
private IEnumerable<Coordinate> GetCoordinates(string gridLine, int xIndex)
|
||||
private IEnumerable<Coordinate> GetRollCoordinates(string gridLine, int xIndex)
|
||||
{
|
||||
var indexedCharacters = gridLine.Index();
|
||||
var validRolls = indexedCharacters.Where(tuple => tuple.Item == '@');
|
||||
|
||||
Reference in New Issue
Block a user