- 4

Please i need help writing this code

/** * The Cell class models each individual cell of the game board. */ public class Cell { // save as Cell.java // package access Seed content; // content of this cell of type Seed. // take a value of Seed.EMPTY, Seed.CROSS, or Seed.NOUGHT int row, col; // row and column of this cell, not used in this program /** Constructor to initialize this cell */ public Cell(int row, int col) { this.row = row; this.col = col; clear(); // clear content } /** Clear the cell content to EMPTY */ public void clear() { content = Seed.EMPTY; } /** Paint itself */ public void paint() { switch (content) { case CROSS: System.out.print(" X "); break; case NOUGHT: System.out.print(" O "); break; case EMPTY: System.out.print(" "); break; } } } Board.java /** * The Board class models the game-board. */ public class Board { // save as Board.java // Named-constants for the dimensions public static final int ROWS = 3; public static final int COLS = 3; // package access Cell[][] cells; // a board composes of ROWS-by-COLS Cell instances int currentRow, currentCol; // the current seed's row and column /** Constructor to initialize the game board */ public Board() { cells = new Cell[ROWS][COLS]; // allocate the array for (int row = 0; row < ROWS; ++row) { for (int col = 0; col < COLS; ++col) { cells[row][col] = new Cell(row, col); // allocate element of the array } } } /** Initialize (or re-initialize) the contents of the game board */ public void init() { for (int row = 0; row < ROWS; ++row) { for (int col = 0; col < COLS; ++col) { cells[row][col].clear(); // clear the cell content } } } /** Return true if it is a draw (i.e., no more EMPTY cell) */ public boolean isDraw() { for (int row = 0; row < ROWS

30th Sep 2018, 11:45 AM
Damilola Ayeni
Damilola Ayeni - avatar
5 Antworten
+ 16
What did tags ever do to you to abuse them in such a way?
30th Sep 2018, 12:55 PM
Haris
Haris - avatar
+ 13
nice tags
30th Sep 2018, 12:09 PM
Mert Yazıcı
Mert Yazıcı - avatar
+ 12
polluted the tags to max level... what a post.
30th Sep 2018, 12:11 PM
Calviղ
Calviղ - avatar
+ 9
it seems like you are missing some tags
30th Sep 2018, 6:33 PM
David Lorenzo
David Lorenzo - avatar
+ 8
Yeah, you need helps.
30th Sep 2018, 12:41 PM
Izaak GOLDSTEIN
Izaak GOLDSTEIN - avatar