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 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;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue