From 772dda0bbc10a92889e460ae786677fdfe6dc53c Mon Sep 17 00:00:00 2001 From: Andrew Ekstedt Date: Sat, 17 Dec 2022 22:35:10 -0800 Subject: [PATCH] day 18 python fix a flood fill bug not sure how this ever worked --- day18/sol.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/day18/sol.py b/day18/sol.py index f71ed65..780fd58 100644 --- a/day18/sol.py +++ b/day18/sol.py @@ -53,11 +53,10 @@ def flood(lava, border): x |= roll(a, 1, +1) x |= roll(a, 2, -1) x |= roll(a, 2, +1) - x = x & ~border - x = x & ~lava - if (a == x).all(): - a |= border + x &= ~lava + b = a | x + if (a == b).all(): return a - a = x + a = b solve()