took out the rules in makestep
This commit is contained in:
parent
730c3cce78
commit
228f908ade
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue