diff options
author | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-29 23:01:54 +0100 |
---|---|---|
committer | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-29 23:01:54 +0100 |
commit | 62a2e6fb7175f683a4d315374efd5bc4ea331dc5 (patch) | |
tree | 6424e50caf9a0c6bb42d8ebc42698558113e5db4 /aoc-2022-dotnet/Day12 | |
parent | ee408551b5327b196cd94bb1b857bcdc9f8b10b1 (diff) | |
download | gleam_aoc2020-62a2e6fb7175f683a4d315374efd5bc4ea331dc5.tar.gz gleam_aoc2020-62a2e6fb7175f683a4d315374efd5bc4ea331dc5.zip |
Finish day 23
Diffstat (limited to 'aoc-2022-dotnet/Day12')
-rw-r--r-- | aoc-2022-dotnet/Day12/Program.fs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/aoc-2022-dotnet/Day12/Program.fs b/aoc-2022-dotnet/Day12/Program.fs index 77417c5..7e1a409 100644 --- a/aoc-2022-dotnet/Day12/Program.fs +++ b/aoc-2022-dotnet/Day12/Program.fs @@ -72,11 +72,10 @@ let solution distanceCalculation = >> Util.mapEachToSeq (fun matrix pos square -> (square, Vec2.neighbours4 pos - |> Seq.filter (fun np -> + |> Set.filter (fun np -> Vec2.inMatrix matrix np && Square.canTraverse square (Util.mAt matrix np)) - |> Seq.map (Vec2.toIndexOf matrix) - |> Set)) + |> Set.map (Vec2.toIndexOf matrix))) >> Seq.indexed >> Map.ofSeq >> Graph |