Refactoring: grundsätzliche Zellenüberprüfung in countAliveNeighbours()
This commit is contained in:
parent
566d74f5bf
commit
b13b551045
Binary file not shown.
@ -59,6 +59,10 @@ public class Life implements ILife {
|
||||
}
|
||||
|
||||
private int countAliveNeighbours() {
|
||||
return 3;
|
||||
int count = 0;
|
||||
if (isAlive(0, 0)) count++;
|
||||
if (isAlive(0, 1)) count++;
|
||||
if (isAlive(0, 2)) count++;
|
||||
return count;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user