Skip to content
Snippets Groups Projects
Commit ccafc31c authored by SAEZ Theo's avatar SAEZ Theo
Browse files

Finalisation des cellules rouges et bleu - Fin du TP

parent 6a0efa4e
No related branches found
No related tags found
No related merge requests found
Pipeline #48176 failed
...@@ -114,7 +114,7 @@ public class Grid implements Iterable<Cell> { ...@@ -114,7 +114,7 @@ public class Grid implements Iterable<Cell> {
return countAliveNeighbors; return countAliveNeighbors;
} }
/** TEST A FAIRE */ /** TEST A FAIRE prbl lorsque je lance le programme, les cellules bleus disparaissent*/
public CellState calculateNextState(int rowIndex, int columnIndex) { public CellState calculateNextState(int rowIndex, int columnIndex) {
int aliveNeighbors = countAliveNeighbors(rowIndex, columnIndex); int aliveNeighbors = countAliveNeighbors(rowIndex, columnIndex);
...@@ -130,7 +130,7 @@ public class Grid implements Iterable<Cell> { ...@@ -130,7 +130,7 @@ public class Grid implements Iterable<Cell> {
if (getCell(rowIndex, columnIndex).isAlive()) { if (getCell(rowIndex, columnIndex).isAlive()) {
if (aliveNeighbors == 2 || aliveNeighbors == 3) { if (aliveNeighbors == 2 || aliveNeighbors == 3) {
if (getCell(rowIndex, columnIndex).getColor() == Color.RED) return CellState.ALIVE_RED; if (getCell(rowIndex, columnIndex).getColor() == Color.RED) return CellState.ALIVE_RED;
else if (getCell(rowIndex, columnIndex).getColor() == Color.RED) return CellState.ALIVE_RED; else if (getCell(rowIndex, columnIndex).getColor() == Color.BLUE) return CellState.ALIVE_BLUE;
} }
} }
else { else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment