Evaluate invalid state

This commit is contained in:
Stefan Waldmann
2022-01-19 07:20:50 +01:00
parent 064907c83e
commit 7dadd251ab

View File

@@ -58,6 +58,9 @@ public class Life {
}
} else { // cell is dead
if (neighbours == 3) {
if (x < 2 || x > 67 || y < 2 || y > 21) {
invalid = true;
}
transitions.add(new Transition(y, x, ALIVE));
population++;
}