nextGeneration() Überprüfung Überbevölkerung - keine weitere Methodenimplementierungen nötig
This commit is contained in:
parent
b1ffd970ab
commit
89bf74f0c3
Binary file not shown.
Binary file not shown.
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user