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

implémentation de la méthode goToNextState

parent ddceea80
Branches
No related tags found
No related merge requests found
......@@ -135,6 +135,14 @@ public class Grid implements Iterable<Cell> {
}
private void goToNextState(boolean[][] nextState) {
for (int i = 0; i < getNumberOfRows(); i++) {
for (int j = 0; j < getNumberOfColumns(); j++) {
if (nextState[i][j])
getCell(i, j).setAlive();
else
getCell(i, j).setDead();
}
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment