Just completed Day 4 of #AdventOfCode in #FunctionalCSharp. I ended up doing this twice, when my first idea for an approach didn't work out. I found the best way was to create Masks, like they do in image processing.
https://github.com/madSimonJ/FunctionalProgrammingWithCSharp/blob/main/AdventOfCode/AdventOfCode/2024/Day04.cs
https://github.com/madSimonJ/FunctionalProgrammingWithCSharp/blob/main/AdventOfCode/AdventOfCode/2024/Day04.cs
Comments
P2 brewed all day in my head, check each 'A' in the grid (leaving out cols/rows at the edges) and check its corners against the 4 possible patterns.