Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA!!! UTF-8 Method /** * Prints the game boards as viewed by the user. This method is used to print the * game boards as

JAVA!!! UTF-8 Method

/** * Prints the game boards as viewed by the user. This method is used to print the * game boards as the user place his ships and also during the gameplay. * * Some notes on the display: * - Each column printed will have a width of Config.MAX_COL_WIDTH. * - Each row is followed by an empty line. * - The values in the headers and cells are to be right justified. * * @param board The board to print. * @param caption The board caption. */ public static void printBoard(char board[][], String caption) { //FIXME }

CONFIG

public class Config { /** * Minimum and maximum values used in the program */ public static final int MIN_WIDTH = 1; //Minimum number of columns public static final int MAX_WIDTH = 675; //Maximum number of columns public static final int MIN_HEIGHT = 1; //Minimum number of rows public static final int MAX_HEIGHT = 99; //Maximum number of rows public static final int MAX_COL_WIDTH = 3; //Maximum number of characters per column public static final int MIN_SHIPS = 1; //Minimum number of ships public static final int MAX_SHIPS = 9; //Maximum number of ships public static final int MIN_SHIP_LEN = 1; //Minimum ship length /** * Character values for displaying the different statuses of the game board cells. */ public static final char WATER_CHAR = '~'; // Water character (not yet targeted) public static final char HIT_CHAR = '*'; // Hit character public static final char MISS_CHAR = '@'; // Miss character /** * Constants for the random processes. */ public static final long SEED = 1234; // The random seed public static final int RAND_SHIP_TRIES = 20; // Maximum number of tries to place a ship } 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Multidimensional Array Data Management In Databases

Authors: Florin Rusu

1st Edition

1638281483, 978-1638281481

More Books

Students also viewed these Databases questions