Skip to content
Snippets Groups Projects
Commit ddceea80 authored by arthur's avatar arthur
Browse files

implémentation de la méthode boolean[][] calculateNextStates

parent fe0fea9b
No related branches found
No related tags found
No related merge requests found
...@@ -95,7 +95,13 @@ public class Grid implements Iterable<Cell> { ...@@ -95,7 +95,13 @@ public class Grid implements Iterable<Cell> {
} }
private boolean[][] calculateNextStates() { private boolean[][] calculateNextStates() {
return null; boolean[][] states = new boolean[getNumberOfRows()][getNumberOfColumns()];
for (int i = 0; i < getNumberOfRows(); i++) {
for (int j = 0; j < getNumberOfColumns(); j++) {
states[i][j] = calculateNextState(i, j, getCell(i, j));
}
}
return states;
} }
private boolean calculateNextState(int rowIndex, int columnIndex, Cell cell) { private boolean calculateNextState(int rowIndex, int columnIndex, Cell cell) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment