mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-27 05:03:27 -08:00
Evaluate invalid state
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user