Skip to content
Snippets Groups Projects
Commit 18d9a2da authored by FAURE Mathias's avatar FAURE Mathias
Browse files

Tout le TP terminé.

parent 52a34777
Branches
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
public class Cell {
private boolean isAlive;
private String color = "Blue";
private String color = "Red";
public Cell(){
this.isAlive = false;
......
......@@ -121,8 +121,10 @@ public class Grid implements Iterable<Cell> {
private boolean calculateNextState(int rowIndex, int columnIndex, Cell cell) {
boolean Nextstate = cell.isAliveInNextState(this.countAliveNeighbours(rowIndex, columnIndex));
if (Nextstate) {
if (this.countAliveNeighbours(rowIndex, columnIndex) != 2) {
cell.setColor(this.countColorNeighbours(rowIndex, columnIndex));
}
}
return Nextstate;
}
......@@ -152,13 +154,14 @@ public class Grid implements Iterable<Cell> {
}
}
if (Red>=Blue) {
if (Red>Blue) {
CounterColorCell="Red";
}
else {
CounterColorCell="Blue";
}
return CounterColorCell;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment