Question: Code for board.java : package battleship; public class Board { // The height and width of the board, in squares. Note that this may //

 Code for board.java : package battleship; public class Board { //

The height and width of the board, in squares. Note that this

may // change without notice! public static final int HEIGHT = 10;

public static final int WIDTH = 10; // Cheating detector, with package

visibility so mischievous students // can't tamper with it. boolean firedAtThisRound; //

Change this to "true" only if you're using Linux and the command

// line. public static boolean GOOD_OPERATING_SYSTEM = false; /** * Constructor that

Code for board.java :

package battleship; public class Board { // The height and width of the board, in squares. Note that this may // change without notice! public static final int HEIGHT = 10; public static final int WIDTH = 10; // Cheating detector, with package visibility so mischievous students // can't tamper with it. boolean firedAtThisRound; // Change this to "true" only if you're using Linux and the command // line. public static boolean GOOD_OPERATING_SYSTEM = false; /** * Constructor that takes a 2-dimensional array of characters as an * argument. The array *must* represent a legitimate board, otherwise * an Exception will be thrown. A "legitimate" board is one that has * exactly five overlapping ships of the proper length (A - length 5, * B - length 4, S - length 3, D - length 3, P - length 2) and has all * other squares set to ' ' (space.) */ public Board(char[][] contents) throws Exception { squares = contents; if (!legit()) { throw new Exception("Bad board! " + toString(0)); } for (int i = 0; i  

I need help making the go() method, the hideships() method, and the reset() method. If it could all be done, that would be great. This is in Java programming by the way.

For the Battleship Project, you will write a program that plays the game Battleship. Your program will implement a gaming algorithm that maintains a state, uses 2-dimensional arrays, and double dispatch. If you submit a working program, your program will compete in live game play against your fellow students to see who implements the best Battleship algorithm For the Battleship Project, you will write a program that plays the game Battleship. Your program will implement a gaming algorithm that maintains a state, uses 2-dimensional arrays, and double dispatch. If you submit a working program, your program will compete in live game play against your fellow students to see who implements the best Battleship algorithm

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!