|
@@ -15,7 +15,7 @@ public class Conway4 extends RuleSet { |
|
|
int numAlive = 0; |
|
|
int numAlive = 0; |
|
|
for (Patch p : neighbors) |
|
|
for (Patch p : neighbors) |
|
|
if (p.getState() == 1) numAlive++; |
|
|
if (p.getState() == 1) numAlive++; |
|
|
Patch p = g.getPatch(i,j).clone(); |
|
|
|
|
|
|
|
|
Patch p = g.getPatch(i,j).clone(newGrid); |
|
|
if (numAlive < 2) { |
|
|
if (numAlive < 2) { |
|
|
p.setState(0); //Dies by underpopulation |
|
|
p.setState(0); //Dies by underpopulation |
|
|
} |
|
|
} |
|
|