Fix Simulation using RuleSet range for neighbor checks
This commit is contained in:
parent
e13962f371
commit
f1399064a2
1 changed files with 1 additions and 1 deletions
|
@ -87,7 +87,7 @@ class Simulation {
|
||||||
for (int i = 0; i < map.length; i++) {
|
for (int i = 0; i < map.length; i++) {
|
||||||
math.Point p = map.toCoordinates(i);
|
math.Point p = map.toCoordinates(i);
|
||||||
bool cell = map[i];
|
bool cell = map[i];
|
||||||
int neighbors = getNeighbors(p.x, p.y, 1);
|
int neighbors = getNeighbors(p.x, p.y, rules.range);
|
||||||
if (cell == false && rules.checkBirth(neighbors) == true) {
|
if (cell == false && rules.checkBirth(neighbors) == true) {
|
||||||
stateChanges[i] = true;
|
stateChanges[i] = true;
|
||||||
} else if (cell == true && rules.checkSurvival(neighbors) == false) {
|
} else if (cell == true && rules.checkSurvival(neighbors) == false) {
|
||||||
|
|
Loading…
Reference in a new issue