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

Diff for: Recursive/FloodFill.js

+2-2
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)