startred working on the makeStep but got lab to do
This commit is contained in:
parent
e2bb167f2f
commit
8f32a83794
|
|
@ -61,9 +61,15 @@ public class Rules {
|
|||
for (int x = 0; x < surviveCells.length; x++) {
|
||||
String elem = surviveCells[x];
|
||||
int value = Integer.parseInt(elem);
|
||||
survivalRulesArray[x] = value;
|
||||
}
|
||||
//determines the number of alive neighboring cells needed to survive, and places them in the neededNb list
|
||||
//determines the number of alive neighboring cells needed to survive, and places them in the survivalRulesArray
|
||||
|
||||
for (int x = 0; x < birthCells.length; x++) {
|
||||
String elem = birthCells[x];
|
||||
int value = Integer.parseInt(elem);
|
||||
birthRulesArray[x] = value;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,6 +133,22 @@ public class Simulator extends Thread {
|
|||
return count;
|
||||
}
|
||||
|
||||
// private boolean survives(int aliveNeighbors) {
|
||||
// for (int value : rules.getSuvivalRulesArray()) {
|
||||
// if ( value == aliveNeighbors) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// private boolean bornes(int aliveNeighbors) {
|
||||
// for(int value : rules.getBirthRulesArray()) {
|
||||
// if (value == aliveNeighbors) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
public void makeStep() {
|
||||
|
|
|
|||
Loading…
Reference in New Issue