Comp 170

Hangman Lab

 

Hangman is a classic word game where you guess a secret word letter by letter. Initially, you know only the number of letters in the word.

Basic Rules

User Interface

  1. Prompt the user for a word to guess.
  2. Get the word from the user.
  3. Clear the screen then display the appropriate number of underscores on the screen.  Be sure to display any letters that have been guessed correctly.
  4. Display the post, rope and appropriate number of body parts for the number of wrong guesses the user has made.
  5. Allow the user to enter a guess letter.
  6. If the user still gets more guesses, clear the screen and go back to step 3.  Otherwise, draw the complete hangman and display the word and “Game Over”.

|---|

|  

| 

|  

| 

^