took out the rules in makestep

This commit is contained in:
Timéo 2024-05-28 10:44:50 +02:00
parent 730c3cce78
commit 228f908ade
1 changed files with 10 additions and 11 deletions

View File

@ -123,16 +123,16 @@ public class Simulator extends Thread {
int[][] newWorld = new int[getWidth()][getHeight()];
// Apply Game of Life rules
for (int x = 0; x < getWidth(); x++) {
for (int y = 0; y < getHeight(); y++) {
int aliveNeighbors = countAliveNeighbors(x, y);
if (world[x][y] == 1) {
newWorld[x][y] = (aliveNeighbors < 2 || aliveNeighbors > 3) ? 0 : 1;
} else {
newWorld[x][y] = (aliveNeighbors == 3) ? 1 : 0;
}
}
}
//for (int x = 0; x < getWidth(); x++) {
// for (int y = 0; y < getHeight(); y++) {
// int aliveNeighbors = countAliveNeighbors(x, y);
// if (world[x][y] == 1) {
// newWorld[x][y] = (aliveNeighbors < 2 || aliveNeighbors > 3) ? 0 : 1;
// } else {
// newWorld[x][y] = (aliveNeighbors == 3) ? 1 : 0;
// }
// }
//}
world = newWorld;
@ -381,7 +381,6 @@ public class Simulator extends Thread {
}
public void setLoopDelay(int delay) {
//TODO : complete method
loopDelay = delay;
}