From 62a2e6fb7175f683a4d315374efd5bc4ea331dc5 Mon Sep 17 00:00:00 2001 From: Tomasz Chojnacki Date: Thu, 29 Dec 2022 23:01:54 +0100 Subject: Finish day 23 --- aoc-2022-dotnet/Day12/Program.fs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'aoc-2022-dotnet/Day12/Program.fs') 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 -- cgit v1.2.3