Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello, I need help finishing the following code. Thanks! I need to edit the code

ID: 3715088 • Letter: H

Question

Hello, I need help finishing the following code. Thanks! I need to edit the code listed below to a battleship game that does the following: Warning, it's a bit lengthy because I've attached all my code.

Basic Requirements:

Your program should allow 1 player to play a game of Battleship against a computer opponent. That includes:

A computer player that functions like a human player, but without any user input.

Your program must allow users to choose between a 1 player game (a human player against a computer player) or a 2 player game (two human players; provided in the skeleton code). Both modes should be fully functional when you submit your final program.

Your computer player must generate different boat positions and attacks each time a game is played. You cannot "hard code" your computer player to make the exact same moves (boat positions and attacks) each time.

Your algorithm for the computer player's attacking strategy can be as simple or complicated as you wish. The key requirement is that your algorithm attacks the human player's board and would, at least eventually, result in the sinking of all ships if a game were to last long enough. You can find an interesting discussion of different algorithmic strategies on this website.

Advanced Requirements

Satisfying both the basic and advanced requirements perfectly, with no points deducted for any reason, will result in a full 10 out of 10 score for this assignment.

Expand on the basic requirements by extending your program as follows.

Add code to keep track of how many times each player attacks the opponent, how many times those attacks miss, and how many times they hit.

Display the current statistics for each player (attacks, hits, misses) at the start of each turn.

This is the code that needs to be adjusted for the requirements mentioned above:

This is the battleship class/code:

Explanation / Answer

Definitions:

The Game theory concept for the battleship game.

--------------------------------------------------------------------------------------------------------------------

Algorithm Execises:

# Ask the user how many players will be playing the game.

#include<stdio.h>

#incude<conio.h>

#include<alloc.h>

#include<process.h>

#include<string.h>

#include<ctype.h>

#include<math.h>

void main( )

{

Int i,n,;

Char num_of_payers;

print("*************** Welcome to BATTLESHIP! ***************")

This is the battleship class/code:

# The BattleshipGame class is the top level class. A game is created for 1 or 2 players, then the game is played

----------------------------------------------------------------------------------------------------------------------

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote