Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedPleae 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions