Skip to content
Snippets Groups Projects
Commit 11d9207d authored by Guyslain's avatar Guyslain
Browse files

section 7 GameOfLifeAutomaton fini

parent 810e3415
Branches
No related tags found
No related merge requests found
......@@ -6,31 +6,33 @@ import java.util.Random;
public class GameOfLifeAutomaton implements CellularAutomaton<GameOfLifeState> {
private final int numberOfColumns;
private final int numberOfRows;
public GameOfLifeAutomaton(int numberOfColumns, int numberOfRows) {
//TODO: à compléter
this.numberOfColumns = numberOfColumns;
this.numberOfRows = numberOfRows;
}
@Override
public int numberOfColumns() {
//TODO: à compléter
return 0;
return numberOfColumns;
}
@Override
public int numberOfRows() {
//TODO: à compléter
return 0;
return numberOfRows;
}
@Override
public GameOfLifeState defaultState() {
//TODO: à compléter
return null;
return GameOfLifeState.DEAD;
}
@Override
public GameOfLifeState randomState(Random generator) {
//TODO: à compléter
return null;
return generator.nextBoolean()?
GameOfLifeState.ALIVE:
GameOfLifeState.DEAD;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment