about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorelioat <{ID}+{username}@users.noreply.github.com>2024-10-24 09:04:44 -0400
committerelioat <{ID}+{username}@users.noreply.github.com>2024-10-24 09:04:44 -0400
commit533379b702ad25835105c0798ff5413d1bf095ef (patch)
tree90428761dbabd1e511b54ea4810f2541d1474b5c
parent526a01dd10466c1b7746f5a3d2207dc6e854bfe2 (diff)
downloadtour-533379b702ad25835105c0798ff5413d1bf095ef.tar.gz
*
-rw-r--r--html/broughlike/index.html3
1 files changed, 1 insertions, 2 deletions
diff --git a/html/broughlike/index.html b/html/broughlike/index.html
index 71cd9d7..b5a4f09 100644
--- a/html/broughlike/index.html
+++ b/html/broughlike/index.html
@@ -161,12 +161,11 @@
             const visited = Array(GRID_SIZE).fill().map(() => Array(GRID_SIZE).fill(false));
 
             function dfs(x, y) {
-                if (x < 0 || x >= GRID_SIZE || y < 0 || y >= GRID_SIZE) return false;
+                if (x < 0 || x >= GRID_SIZE || y < 0 || y >= GRID_SIZE) return false; // Are the coordinates in bounds?
                 if (visited[x][y]) return false;
                 if (walls.some(wall => wall.x === x && wall.y === y)) return false;
                 visited[x][y] = true;
                 if (x === exit.x && y === exit.y) return true;
-
                 return dfs(x + 1, y) || dfs(x - 1, y) || dfs(x, y + 1) || dfs(x, y - 1);
             }