package conway1_26; /** * * @author levenick Jan 26, 2017 9:54:41 AM */ class Life { Cell[][] sq; private final int N; Life(int i) { N = i; sq = new Cell[N][N]; // allocate the array for (int row = 0; row < N; row++) { for (int col = 0; col < N; col++) { sq[row][col] = new Cell(); } }//populate the array sq[5][5].setAlive(true); sq[5][5].setCountNbrs(666); } void step() { System.out.println("fake step"); } @Override public String toString() { String returnMe = "Life{" + "\n\n"; for (int row = 0; row < N; row++) { for (int col = 0; col < N; col++) { returnMe += " " + sq[row][col].toString(); } returnMe += "\n"; } return returnMe; } public String toStringCounts() { String returnMe = "counts{" + "\n\n"; for (int row = 0; row < N; row++) { for (int col = 0; col < N; col++) { returnMe += " " + sq[row][col].getCountNbrs(); } returnMe += "\n"; } return returnMe; } }