Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions Hangman The task is to implement a word guessing game on the model of Hangman. The game starts with a hidden word in which

Instructions
Hangman
The task is to implement a word guessing game on the model of "Hangman". The game starts with a hidden word in which hyphens are displayed in place of letters. The player guesses a letter, and if the letter is in the word, the word display is updated to reveal the letter in place. If the word does not contain the letter guessed, the player gets one "strike".
NOTE: you do not need to implement the drawing of the hanged man, as in the children's game.
If the player gets five strikes before all letters are revealed, the player loses. If the player is able to guess all letters before getting five strikes, the player wins.
Requirements
Your program should do the following:
Include a function that take a word and list of letters guessed and returns a string that displays the letters guessed only, with hyphens in place of letters not guessed. HINT: You can loop over the letters in a word and concatenate a new word from letters and hyphens depending on whether a given letter is present in a list of letters guessed.
Display the letters guessed so far to the user.
Be able to handle user input in either uppercase or lowercase.
Allow the user to quit the game by typing "quit".
Instructions
The task is to implement a word guessing game on the model of "Hangman". The game starts with a hidden word in which hyphens are displayed in place of letters. The player guesses a letter, and if the letter is in the word, the word display is updated to reveal the letter in place. If the word does not contain the letter guessed, the player gets one "strike".
NOTE: you do not need to implement the drawing of the hanged man, as in the children's game.
If the player gets five strikes before all letters are revealed, the player loses. If the player is able to guess all letters before getting five strikes, the player wins.
Requirements
Your program should do the following:
Include a function that take a word and list of letters guessed and returns a string that displays the letters guessed only, with hyphens in place of letters not guessed. HINT: You can loop over the letters in a word and concatenate a new word from letters and hyphens depending on whether a given letter is present in a list of letters guessed.
Display the letters guessed so far to the user.
Be able to handle user input in either uppercase or lowercase.
Allow the user to quit the game by typing "quit".
image text in transcribed

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

Big Data With Hadoop MapReduce A Classroom Approach

Authors: Rathinaraja Jeyaraj ,Ganeshkumar Pugalendhi ,Anand Paul

1st Edition

1774634848, 978-1774634844

More Books

Students also viewed these Databases questions

Question

state what is meant by the term performance management

Answered: 1 week ago