You are on page 1of 1

Hangman game guidelines:

1. Users will be allowed 9 lives or tries for guesses


2. You can use a set of 5 letter words
3. You are to show them a clue with ‘?’ in place of the letters
4. As each correct letter is guessed, the ‘?’ will be replaced with the correct letter
5. Once all correct letters are guessed or the actual word is guessed then you are to
display ‘ You won. You guessed the secret word __________.”
6. Else you should display “ You lost. The secret word was __________.”

Algorithm:

1. Lives set to 9, secret_word set to random choice from the list


2. While lives > 0:
3. Show the clue ( Word with ?????)
4. Wait for user’s guess
5. If guess letter in word, show updated clue
6. If guess letter not in word say incorrect, life - 1, show lives:
7. If all letters guessed, no more ? then exit and congratulate
8. If not able to guess, then ‘ You lose. Secret word was _______.’

Upload by 23/4/20 3pm


Must add comment lines.

You might also like