The displayBoard method currently prints the game board without any formatting.
ID: 3619709 • Letter: T
Question
The displayBoard method currently prints the game board without anyformatting. It should print the board as displayed in the comments for the
method.
public static void displayBoard(final char[][] theBoard) {
// note the final parameter - we won't change the board, just print it.
// Need to format the board display to look like this:
// | |
// -----
// | |
// -----
// | |
for (int row = 0; row < board_size; row++) {
for (int col = 0; col < board_size; col++) {
System.out.print(theBoard[row][col]); // row always comes first in a 2d array
}
System.out.println();
}
}
Explanation / Answer
please rate - thanksRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.