diff options
author | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-30 14:35:09 +0100 |
---|---|---|
committer | Tomasz Chojnacki <tomaszchojnacki2001@gmail.com> | 2022-12-30 14:35:09 +0100 |
commit | 353d185a1f89654f999dca7b75016ebef461a23c (patch) | |
tree | 24acbc0bd35385312a563263ce3b665d49a5ffe9 /aoc-2022-dotnet/Day14 | |
parent | 62a2e6fb7175f683a4d315374efd5bc4ea331dc5 (diff) | |
download | gleam_aoc2020-353d185a1f89654f999dca7b75016ebef461a23c.tar.gz gleam_aoc2020-353d185a1f89654f999dca7b75016ebef461a23c.zip |
Finish day 24
Diffstat (limited to 'aoc-2022-dotnet/Day14')
-rw-r--r-- | aoc-2022-dotnet/Day14/Program.fs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/aoc-2022-dotnet/Day14/Program.fs b/aoc-2022-dotnet/Day14/Program.fs index b3ff4f9..018664a 100644 --- a/aoc-2022-dotnet/Day14/Program.fs +++ b/aoc-2022-dotnet/Day14/Program.fs @@ -28,11 +28,11 @@ let buildCaveScan = let solution1 input = let initialCaveScan = buildCaveScan input - let voidY = initialCaveScan |> Seq.map Vec2.y |> Seq.min + let voidY = initialCaveScan |> Seq.map Vec2.getY |> Seq.min let settleNewUnit caveScan = let rec fall pos = - if Vec2.y pos <= voidY then + if Vec2.getY pos <= voidY then None else sandMoveOffsets @@ -55,12 +55,12 @@ let solution1 input = let solution2 input = let caveScan = buildCaveScan input - let floorY = caveScan |> Seq.map Vec2.y |> Seq.min |> (+) -2 + let floorY = caveScan |> Seq.map Vec2.getY |> Seq.min |> (+) -2 let neighbours pos = sandMoveOffsets |> List.map ((+) pos) - |> List.filter (fun pos -> Util.notIn caveScan pos && Vec2.y pos <> floorY) + |> List.filter (fun pos -> Util.notIn caveScan pos && Vec2.getY pos <> floorY) let rec dfs vis = function |