From 37bdfe789f9450e5ac26ef4ac58d8297d3cb95ab Mon Sep 17 00:00:00 2001 From: arthur <c19222814> Date: Tue, 6 Oct 2020 20:32:25 +0200 Subject: [PATCH] =?UTF-8?q?impl=C3=A9mentation=20de=20la=20m=C3=A9thode=20?= =?UTF-8?q?goToNextState?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Grid.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Grid.java b/Grid.java index 00da4b9..d2d90e3 100644 --- a/Grid.java +++ b/Grid.java @@ -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(); + } + } } /** -- GitLab