diff --git a/Grid.java b/Grid.java index c69da33ee09eab130b063508dfb5654a350ea0f0..00da4b9ae085e9405b273e3b1e537636c0d53f9a 100644 --- a/Grid.java +++ b/Grid.java @@ -95,7 +95,13 @@ public class Grid implements Iterable<Cell> { } 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) {