Skip to content

Commit f405dde

Browse files
authored
Fix oops
1 parent ecdcebb commit f405dde

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Recursive/FloodFill.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ function breadthFirstFill(
105105

106106
if (rgbData[currentLocation[0]][currentLocation[1]] === targetColor) {
107107
rgbData[currentLocation[0]][currentLocation[1]] = replacementColor
108-
for (const neighborLocation of neighbors(currentLocation)) {
108+
for (const neighborLocation of neighbors(rgbData, currentLocation)) {
109109
queue.push(neighborLocation)
110110
}
111111
}
@@ -122,7 +122,7 @@ function breadthFirstFill(
122122
function depthFirstFill(rgbData, location, targetColor, replacementColor) {
123123
if (rgbData[location[0]][location[1]] === targetColor) {
124124
rgbData[location[0]][location[1]] = replacementColor
125-
for (const neighborLocation of neighbors(currentLocation)) {
125+
for (const neighborLocation of neighbors(rgbData, currentLocation)) {
126126
depthFirstFill(rgbData, neighborLocation, targetColor, replacementColor)
127127
}
128128
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy