startred working on the makeStep but got lab to do

This commit is contained in:
Timéo 2024-05-29 14:28:01 +02:00
parent e2bb167f2f
commit 8f32a83794
2 changed files with 24 additions and 2 deletions

View File

@ -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;
}
}
}

View File

@ -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() {