Merge branch 'master' of
https://gitarero.ecam.fr/laure.bel/OOP_F3_Project.git
This commit is contained in:
parent
739d7c7dd3
commit
5bda7e3619
|
|
@ -301,20 +301,7 @@ public class Simulator extends Thread {
|
||||||
* @param chanceOfLife the chance for each cell
|
* @param chanceOfLife the chance for each cell
|
||||||
* to be alive in new state
|
* to be alive in new state
|
||||||
*/
|
*/
|
||||||
public ArrayList<String> getRule() { //to check
|
|
||||||
ArrayList<String> rule = new ArrayList<>();
|
|
||||||
for (int i = 0; i < getHeight(); i++) {
|
|
||||||
StringBuilder lineState = new StringBuilder();
|
|
||||||
for (int j = 0 ; j < getHeight() ; j++) {
|
|
||||||
lineState.append(getCell(i, j));
|
|
||||||
if (j < getWidth() - 1) {
|
|
||||||
lineState.append(";");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rule.add(lineState.toString());
|
|
||||||
}
|
|
||||||
return rule;
|
|
||||||
}
|
|
||||||
public void generateRandom(float chanceOfLife) {
|
public void generateRandom(float chanceOfLife) {
|
||||||
/*
|
/*
|
||||||
* Advice :
|
* Advice :
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue