1. Engineering
  2. Computer Science
  3. write a program that implements the word guessing game hangman...

Question: write a program that implements the word guessing game hangman...

Question details

Write a program that implements the word guessing game (hangman) we wrote an algorithm for in Lecture 2 (you may use the algorithm provided in that lecture to help you write your code).

1. define secret word

2. create a revealed letter list that starts empty

2. set wrong guess count to 0

3. ask the user for a letter

4. is the letter in the secret word?

5. if so: add it to the revealed letters list

create a blank string

for each letter in the secret word, if the letter in

revealed letter list, add that letter to string,

otherwise add an underscore to string

6. if letter not in secret word, add one to wrong guess

7. repeat from step 3

python for language

please use code blocks

please add comments for each line of code

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution