From c246203fdfb962feb9cf8d85a9af95e7c43e62fb Mon Sep 17 00:00:00 2001 From: Lennard Schober Date: Thu, 2 May 2024 16:55:38 +0200 Subject: [PATCH] Fix bug with recursive DFS --- js/scripts2.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/scripts2.js b/js/scripts2.js index 1ed84ca..ec3c3d1 100644 --- a/js/scripts2.js +++ b/js/scripts2.js @@ -1549,11 +1549,13 @@ async function generateRecursiveDFS() { // open one random side of end point if encased if (!endHasEmptyNeighbors()) { let temp = getClosedSides(); + console.log(temp) + console.log(tRow, tCol); shuffle(temp); const [dx, dy] = temp[0]; - const mx = tCol + dx; - const my = tRow + dy; - globalGrid[my][mx] = 0; // Make the wall a passage + const mx = tRow + dx; + const my = tCol + dy; + globalGrid[mx][my] = 0; // Make the wall a passage } stopper = 0;