Question: Rules of Word Guess If the player makes five incorrect guesses (misses), the player loses. Player can only guess one letter at time. If a

Rules of Word Guess

If the player makes five incorrect guesses (misses), the player loses.

Player can only guess one letter at time.

If a player guesses a letter that occurs in the secret word multiple times, each occurrence of the letter is revealed.

Game Play

As long as the player has made fewer than five misses and has not guessed all the letters in the word:

Print a line reporting the current missed letters and the number of remaining misses before the player loses.

Print a line reporting the current guess with underscores, '_', for letters which havent yet been guessed.

Print a prompt for the user to enter a letter on the same line as the prompt.

Read a letter from the console.

Update the current guess and the number of misses accordingly.

Print a line reporting all the letters the player missed in the game.

Print a line reporting the final guess, including '_' characters for letters that werent guessed.

If the player lost, print a line saying Sorry, too many missess. and what the secret word was.

If the player won, print a line saying Congratulations! You got it! (the full secret word will have already been printed).

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!