For this challenge, you are going to create a game of hangman. The computer will pick a word randomly within a given list of words. The player will have to guess the word by suggesting one letter at a time and the computer will automatically check if the letter given is included in the word to guess. If not it will add one element to the hanged stick man drawing.
Complete the Code
We have started the code for you, but you will need to complete this code:
Step 1: Display the word replacing “_” with letters that have been guessed correctly. You can use the following flowchart to help you with this step:
Step 2: Display the hangman based on the number of lives remaining.
Step 3: Use a loop to repeat the above steps. The game should stop when the user guessed the words or when they have lost all their lives.
Solution...
The solution for this challenge is available to full members!Find out how to become a member:
➤ Members' Area