Skip to content

Commit

Permalink
Add print
Browse files Browse the repository at this point in the history
  • Loading branch information
premun committed Dec 16, 2023
1 parent 51d0ad6 commit fa0aa24
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/2023/16/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
var height = map.GetLength(0);
var width = map.GetLength(1);

int[] results =
int[] allScores =
[
.. Enumerable.Range(0, height).Select(row => SimulateRays(new Coor(row, -1), Coor.Right)),
.. Enumerable.Range(0, height).Select(row => SimulateRays(new Coor(row, width), Coor.Left)),
Expand All @@ -15,7 +15,7 @@ .. Enumerable.Range(0, width).Select(col => SimulateRays(new Coor(height, col),
];

Console.WriteLine($"Part 1: {SimulateRays(new Coor(0, -1), Coor.Right)}");
Console.WriteLine($"Part 2: {results.Max()}");
Console.WriteLine($"Part 2: {allScores.Max()}");

int SimulateRays(Coor startPosition, Coor startDirection)
{
Expand Down Expand Up @@ -101,6 +101,7 @@ int SimulateRays(Coor startPosition, Coor startDirection)
}
}

// map.Print(c => energized.Get(c) ? '#' : null);
return result;
}

Expand Down

0 comments on commit fa0aa24

Please sign in to comment.