diff --git a/src/backend/Rules.java b/src/backend/Rules.java index a979f9b..ea11e5c 100644 --- a/src/backend/Rules.java +++ b/src/backend/Rules.java @@ -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; + } } } diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index 362d3eb..6aa878f 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -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() {