diff options
Diffstat (limited to 'html')
-rw-r--r-- | html/broughlike/index.html | 3 |
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); } |