From 9032c29e28880afa21f81f491bf0277ded95e9a4 Mon Sep 17 00:00:00 2001 From: Matt Russell Date: Wed, 4 Dec 2024 18:14:38 +0000 Subject: [PATCH] credit diagonals --- Aoc2024/Day04/Solve.lean | 1 + 1 file changed, 1 insertion(+) diff --git a/Aoc2024/Day04/Solve.lean b/Aoc2024/Day04/Solve.lean index 9d2e419..d175be7 100644 --- a/Aoc2024/Day04/Solve.lean +++ b/Aoc2024/Day04/Solve.lean @@ -22,6 +22,7 @@ private def gridToString (g : Grid) : String := g.map List.asString |> String.in private def flipHorizontal (grid : Grid) : Grid := grid.map (·.reverse) +-- ported from https://hackage.haskell.org/package/universe-base-1.1.4/docs/src/Data.Universe.Helpers.html#diagonals private def diagonals (grid : List (List α)) : List (List α) := let rec go (b : List (List α)) (es : List (List α)) : List (List α) := let diagonal := b.filterMap List.head?