Question: Pleae show how to do this with functions in c Design a simple battleship game. One player plays against the computer. The computer picks at

Pleae show how to do this with functions in c Design aPleae show how to do this with functions in c

Design a simple battleship game. One player plays against the computer. The computer picks at random a number between 0 and 9 (inclusive). The number the computer picks is the location of the battleship. The player tries to guess the location of the battleship in a maximum of 3 tries. To guess the location, the player enters a number (0-9) The computer displays the game board as a row of dots (periods). If the player finds the battleship, the computer displays the game board with an 'H' in the position where the ship was hit. If the player misses, the computer displays an 'm'. All other locations remain dots. Example run: Computer Battleship (Simplified Version) Try to find the battleship and sink her. To fire a torpedo, enter a location (number between 0 and ). You have three torpedos. Let's see if you have any skill! (e 4 9) Enter a location between and 9: 3 Missed! Try again. 4 9) Enter a location between and 9: 5 BOOM! A hit! (e 4 9) You win! (Game Over) Design a simple battleship game. One player plays against the computer. The computer picks at random a number between 0 and 9 (inclusive). The number the computer picks is the location of the battleship. The player tries to guess the location of the battleship in a maximum of 3 tries. To guess the location, the player enters a number (0-9) The computer displays the game board as a row of dots (periods). If the player finds the battleship, the computer displays the game board with an 'H' in the position where the ship was hit. If the player misses, the computer displays an 'm'. All other locations remain dots. Example run: Computer Battleship (Simplified Version) Try to find the battleship and sink her. To fire a torpedo, enter a location (number between 0 and ). You have three torpedos. Let's see if you have any skill! (e 4 9) Enter a location between and 9: 3 Missed! Try again. 4 9) Enter a location between and 9: 5 BOOM! A hit! (e 4 9) You win! (Game Over)

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!