This commit is contained in:
Laure BEL 2024-05-29 18:33:44 +02:00
parent c2f9c4d976
commit 102bae29bb
1 changed files with 11 additions and 13 deletions

View File

@ -140,17 +140,15 @@ public class Simulator extends Thread {
for (int x = 0; x < getWidth(); x++) { for (int x = 0; x < getWidth(); x++) {
for (int y = 0; y < getHeight(); y++) { for (int y = 0; y < getHeight(); y++) {
int aliveNeighbors = countAliveNeighbors(x, y); int aliveNeighbors = countAliveNeighbors(x, y);
//for (int x = 0; x < getWidth(); x++) { if (world[x][y] == 1) {
// for (int y = 0; y < getHeight(); y++) { newWorld[x][y] = (aliveNeighbors < 2 || aliveNeighbors > 3) ? 0 : 1;
// int aliveNeighbors = countAliveNeighbors(x, y); } else {
// if (world[x][y] == 1) { newWorld[x][y] = (aliveNeighbors == 3) ? 1 : 0;
// newWorld[x][y] = (aliveNeighbors < 2 || aliveNeighbors > 3) ? 0 : 1; }
// } else {
}
}
world = newWorld;
//world = newWorld;