From 35f32b2a15a7936eba19d2ae3d4c4ca15e5b5a96 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Mon, 11 Dec 2023 10:57:30 +0100 Subject: [PATCH] d10 bugfix --- Day10/Part1.js | 2 +- Day10/Part2.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Day10/Part1.js b/Day10/Part1.js index 5c2c35d..6b261a2 100644 --- a/Day10/Part1.js +++ b/Day10/Part1.js @@ -74,7 +74,7 @@ while (open.length > 0) { }; if (closed.some((e) => compare(e, next))) continue; - if (!relPos(bends[symbol], -i, -j)) continue; + if (!bends[symbol] || !relPos(bends[symbol], -i, -j)) continue; open.push(next); } diff --git a/Day10/Part2.js b/Day10/Part2.js index efbbabd..c8c2457 100644 --- a/Day10/Part2.js +++ b/Day10/Part2.js @@ -75,7 +75,7 @@ while (open.length > 0) { }; if (closed.some((e) => compare(e, next))) continue; - if (!relPos(bends[symbol], -i, -j)) continue; + if (!bends[symbol] || !relPos(bends[symbol], -i, -j)) continue; open.push(next); }