Initializing with conway

This commit is contained in:
l.dupuis-burtin 2024-05-29 10:38:41 +02:00
parent 82bcd85852
commit 8c93942fb6
1 changed files with 6 additions and 2 deletions

View File

@ -30,6 +30,7 @@ public class Simulator extends Thread {
private boolean clickActionFlag;
private int loopDelay = 150;
private ArrayList<Integer> ruleSurviveCriteria= new ArrayList<Integer>();
private ArrayList<Integer> ruleBirthCriteria=new ArrayList<Integer>() ;
//Rules rule = new Rules();
//TODO : add missing attribute(s)
@ -49,6 +50,9 @@ public class Simulator extends Thread {
//TODO : add missing attribute initialization
ruleSurviveCriteria.add(2);//initializing system with conway rule
ruleSurviveCriteria.add(3);
ruleBirthCriteria.add(3);
//initialize grid with dead cells
for(int x=0; x < getWidth();x++) {
ArrayList<Cell> arrayCell = new ArrayList<Cell>(); //initialize first dimension with ArrayLists