nextGeneration() Überprüfung Überbevölkerung - keine weitere Methodenimplementierungen nötig

This commit is contained in:
Susanne 2025-02-16 16:10:31 +01:00
parent b1ffd970ab
commit 89bf74f0c3
3 changed files with 2 additions and 0 deletions

View File

@ -56,6 +56,8 @@ public class Life implements ILife {
next.setAlive(x, y); next.setAlive(x, y);
} else if (countAliveNeighbours(x, y) < 2) { } else if (countAliveNeighbours(x, y) < 2) {
next.setDead(x, y); next.setDead(x, y);
} else if (countAliveNeighbours(x, y) > 3) {
next.setDead(x, y);
} }
} }
} }