day 18 python fix a flood fill bug

not sure how this ever worked
main
magical 2022-12-17 22:35:10 -08:00
parent 4b5b25e56b
commit 772dda0bbc
1 changed files with 4 additions and 5 deletions

View File

@ -53,11 +53,10 @@ def flood(lava, border):
x |= roll(a, 1, +1) x |= roll(a, 1, +1)
x |= roll(a, 2, -1) x |= roll(a, 2, -1)
x |= roll(a, 2, +1) x |= roll(a, 2, +1)
x = x & ~border x &= ~lava
x = x & ~lava b = a | x
if (a == x).all(): if (a == b).all():
a |= border
return a return a
a = x a = b
solve() solve()