Skip to content
Snippets Groups Projects
Commit 05541007 authored by arthur's avatar arthur
Browse files

implémentation de la méthode randomGeneration

parent 434a974f
No related branches found
No related tags found
No related merge requests found
......@@ -163,6 +163,12 @@ public class Grid implements Iterable<Cell> {
*/
void randomGeneration(Random random) {
GridIterator iterator = new GridIterator(this);
while (iterator.hasNext()) {
if (random.nextBoolean())
iterator.next().setAlive();
else
iterator.next().setDead();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment