Question: Create a basic battleship game of C++ on a 10 by 10 grid using arrays for human vs computer interaction. The ships that will be

Create a basic battleship game of C++ on a 10 by 10 grid using arrays for human vs computer interaction.

The ships that will be used:

Carrier: 5 spots

Battleship: 4 spots

Cruiser: 3 spots

Submarine: 3 spots

Destroyer: 2 spots

The program should have functions.

The computer should be able to randomly place each of the ships legally and randomly hit a ship, but once the computer knows it has hit a ship it should make an educated guess where to hit so that it can get rid of the ship

The program should display hit and miss locations using (A-J) for rows

and (1-10) for columns and the user should be able to see their placement of the ships on the (ocean) grid.

Each turn, the user should get an update on the (target) grid from misses and hits as well on the board.

Please use comments. Also, if any of this sounds confusing it's pretty much normal battle ship but the 2nd player is the computer.

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!