diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index f2bda2f..296dc04 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -130,9 +130,9 @@ public class Simulator extends Thread { agent.getY(), ANIMAL_AREA_RADIUS);} //if(!agent.liveTurn( - // neighbors, - // this)) { - // agents.remove(agent); + // neighbors, + //this)) { + //agents.remove(agent); //{ @@ -140,17 +140,15 @@ public class Simulator extends Thread { for (int x = 0; x < getWidth(); x++) { for (int y = 0; y < getHeight(); y++) { int aliveNeighbors = countAliveNeighbors(x, y); - //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 { + if (world[x][y] == 1) { + newWorld[x][y] = (aliveNeighbors < 2 || aliveNeighbors > 3) ? 0 : 1; + } else { + newWorld[x][y] = (aliveNeighbors == 3) ? 1 : 0; + } - - - - //world = newWorld; + } + } + world = newWorld;