Skip to content
Snippets Groups Projects
Commit ef561484 authored by SAHIN Melis damla's avatar SAHIN Melis damla
Browse files

ajouté la correction avec if aussi

parent 85a4fe5f
No related branches found
No related tags found
No related merge requests found
Pipeline #40924 failed
......@@ -19,10 +19,18 @@ public enum GameOfLifeState implements State<GameOfLifeState> {
return Color.RED;
case DEAD:
return Color.WHITE;
default : return Color.WHITE;
default:
return Color.WHITE;
}
}
/* correction avec if :
if this.equals(ALIVE) {
return COLOR.RED;
else {
return COLOR.WHITE;
*/
@Override
public GameOfLifeState next() {
switch (this) {
......@@ -30,9 +38,16 @@ public enum GameOfLifeState implements State<GameOfLifeState> {
return DEAD;
case DEAD:
return ALIVE;
default : return DEAD;
default:
return DEAD;
}
}
/* correction avec if :
if this.equals(ALIVE) {
return DEAD;
else {
return ALIVE;
*/
@Override
public GameOfLifeState update(List<GameOfLifeState> neighbours) {
......@@ -54,4 +69,3 @@ public enum GameOfLifeState implements State<GameOfLifeState> {
return DEAD;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment