get rule finally
This commit is contained in:
parent
5bda7e3619
commit
63ea7a1b4d
|
|
@ -301,7 +301,20 @@ public class Simulator extends Thread {
|
|||
* @param chanceOfLife the chance for each cell
|
||||
* 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) {
|
||||
/*
|
||||
* Advice :
|
||||
|
|
|
|||
Loading…
Reference in New Issue