Preventing flooder from checking same node.

Added another flooder test.
This commit is contained in:
2020-04-27 23:17:54 -05:00
parent 85ec44a4d7
commit 7c073cdc6e
2 changed files with 22 additions and 6 deletions

View File

@@ -99,4 +99,19 @@ public class FloodFillTest {
}
}
}
@Test
public void testFillMapBNonCorner() {
Flooder flooder = new Flooder(new Point2(43, 11), new Flood(mapB));
flooder.start();
for (int y = 0; y < mapB.length; y++) {
for (int x = 0; x < mapB[y].length; x++) {
if (x > 21 && y > 15 && x < 27) {
assertTrue(mapB[y][x] > 0, String.format("At: %d, %d", x, y));
} else {
assertEquals(0, mapB[y][x], String.format("At: %d, %d", x, y));
}
}
}
}
}