Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to creat a graphical output for the Game of Life, which replaces my Syste

ID: 3911440 • Letter: I

Question

I need to creat a graphical output for the Game of Life, which replaces my System.out.println toString from my previous assignment. I posted below my previous code of the class as well as a screenshot of what the end assignment should look like and some guidance on writing the code.

public class MyGameOfLife implements GameOfLife {

private int [][] size;

public MyGameOfLife() {
size = new int[19][19];
}

public int getCellState(int row, int col) {
return size[row - 1][col - 1];
}

public void setCellState(int row, int col, int state) {
size[row - 1][col - 1] = state;
}

public void nextGeneration() {
}

public String toString() {
StringBuilder sb = new StringBuilder();
for(int i = 0; i < size.length; i++) {
for(int j = 0; j < size[i].length; j++) {
sb.append(String.format("%c ",size[i][j] == ALIVE ? 'O' : '.'));
}
sb.append(" ");
}
return sb.toString();
}
}

Graphical Output Component The lot dis 19:ews or 19 cells The (ells sbdllaytt betdee, l piel tuck on ca?ofthe Rue sides Usea saple praplical sbage N represente live cells The dead cells saleta t'eapy Crete an apglicatoe hod n) This can be in the Can ofLdDannd cless n main, creete a Trne Yo can h)se tbe lecarion and tofe ofthe vinde. The sze will be set by calling pck This iswty the Ceme01iond needs ot set is preferred size Renenter o set the deun close opem on sehat he pon endwen the window is ctosed The anan for Nam Cenerense ?.ocal no mnA tough

Explanation / Answer

i am giving you the code for main logic of Game.. you, should post another question for UI side implementation as that will be a very big question to answer here. Thanks!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote