diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index 5e1baae..e213015 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -178,7 +178,8 @@ public class Simulator extends Thread { for (int y = 0; y < getHeight(); y++) { int aliveNeighbors = countAliveNeighbors(x, y); if (world.getCell(x, y) == 1) { - nextWorld[x][y] = survives(aliveNeighbors) ? 1 : 0; + nextWorld[x][y] = 1; + //survives(aliveNeighbors) ? 1 : 0; } else { nextWorld[x][y] = bornes(aliveNeighbors) ? 1 : 0; } diff --git a/src/backend/World.java b/src/backend/World.java index 82137d6..3c1cfe9 100644 --- a/src/backend/World.java +++ b/src/backend/World.java @@ -35,14 +35,26 @@ public class World { - public void setWorld(int[][] actualworld, int width, int height) { - this.world = actualworld; + public void setWorld(int[][] world, int width, int height) { + this.world = world; this.width = width; - this.height = height; + this.height = height; + printArray (world); } //initializes the world - + public void printArray(int[][] array) { + for (int i = 0; i < array.length; i++) { + System.out.print("["); + for (int j = 0; j < array[i].length; j++) { + System.out.print(array[i][j]); + if (j < array[i].length - 1) { + System.out.print(", "); + } + } + System.out.println("]"); + } + }