done
This commit is contained in:
parent
c2f9c4d976
commit
102bae29bb
|
|
@ -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;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue