1.Play Battle Ship on a 4x4 grid 2.Place two ships (size 3 and 2) randomly 3.cho
ID: 3625217 • Letter: 1
Question
1.Play Battle Ship on a 4x4 grid2.Place two ships (size 3 and 2) randomly
3.choice to be first or second player
4.graphical display of the board
5.intuitive way to place moves using position numbers below. Program must verify user move (input) is correct before placing the move (attack).
6.Each program is responsible for checking the desired moves of the opponent. If opponent makes an illegal move, message should display the illegal move. It is you program’s job to recognize that it is an illegal move and state as such. If your program makes an illegal move and is caught by the opponent program, then it will result in a loss. If your program incorrectly state that opponent made an illegal move, then you forfeit the game.
7.after each game, determine and display the winner
8.after the match (two games), display game score
9.If the statistics of points and such is incorrectly displayed, then it will count as a loss.
10.If a player gets a hit, they are allowed to take another shot. Even if the player gets another hit, their turn is done
Positions are as follows
0,0 0,1 0,2 0,3
1,0 1,1 1,2 1,3
2,0 2,1 2,2 2,3
3,0 3,1 3,2 3,3
Please help I am lost as to where even to start
Explanation / Answer
Try this code out.. it might help you understand the concepts #include using namespace std; // Game properties const int ROWS = 5; // Pre-set number of rows in the game board const int COLUMNS = 5; // Pre-set number of columns in the game board const int TOTAL_SHIPS = 5; // Pre-set number of ships to place in the game // Values to fill the array const char HIT = 'X'; // Special character to represent a Hit const char MISS = 'M'; // Special character to represent a Miss const char SHIP = 'S'; // Special character to represent an Unrevealed Ship const char WATER = ' '; // Special character to represent Unrevealed Water //--------------------------------------------------- //Name: getChoice //Purpose: Prompts the user for the Main Menu choice //Return: Returns the user's choice //--------------------------------------------------- int getChoice() { int menuChoice; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.