Hangman Example 2

Here is a version with ascii graphics added (adding ascii graphics is not required, but is one extra feature you can add if you have time). Also, in this example, the player doesn't win, so note what the program prints out at the end:

$ python hangman.py

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This program plays a game of hangman.
Guess letters in the mystery word.
You can only make 8 incorrect guesses before you lose.
See if you can guess the word before you run out of guesses...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

word:  -  -  -  -  -  -  -  -  -  -  -  - 
incorrect guesses left: 8

Enter a letter: a
 good guess, 'a' is in the word.

      -------
    |/      |
    |
    |
    |
    | 
    | 
____|____

word:  -  -  -  a  -  -  -  -  -  -  -  - 
incorrect guesses left: 8

Enter a letter: e
 good guess, 'e' is in the word.

      -------
    |/      |
    |
    |
    |
    | 
    | 
____|____

word:  -  -  -  a  -  -  e  -  -  e  -  - 
incorrect guesses left: 8

Enter a letter: i
 good guess, 'i' is in the word.

      -------
    |/      |
    |
    |
    |
    | 
    | 
____|____

word:  i  -  -  a  -  -  e  -  -  e  -  - 
incorrect guesses left: 8

Enter a letter: o
 sorry there is no 'o' in the word.

      -------
    |/      |
    |      (_)
    |
    |
    | 
    | 
____|____

word:  i  -  -  a  -  -  e  -  -  e  -  - 
incorrect guesses left: 7

Enter a letter: m
 sorry there is no 'm' in the word.

      -------
    |/      |
    |      (_)
    |       |
    |       |
    | 
    | 
____|____

word:  i  -  -  a  -  -  e  -  -  e  -  - 
incorrect guesses left: 6

Enter a letter: u
 sorry there is no 'u' in the word.

      -------
    |/      |
    |      (_)
    |      \|
    |       |
    | 
    | 
____|____

word:  i  -  -  a  -  -  e  -  -  e  -  - 
incorrect guesses left: 5

Enter a letter: n
 good guess, 'n' is in the word.

      -------
    |/      |
    |      (_)
    |      \|
    |       |
    | 
    | 
____|____

word:  i  n  -  a  n  -  e  -  -  e  n  - 
incorrect guesses left: 5

Enter a letter: g
 sorry there is no 'g' in the word.

      -------
    |/      |
    |      (_)
    |      \|/
    |       |
    | 
    | 
____|____

word:  i  n  -  a  n  -  e  -  -  e  n  - 
incorrect guesses left: 4

Enter a letter: t
 good guess, 't' is in the word.

      -------
    |/      |
    |      (_)
    |      \|/
    |       |
    | 
    | 
____|____

word:  i  n  -  a  n  -  e  -  -  e  n  t 
incorrect guesses left: 4

Enter a letter: m
You already guessed 'm', try again...
Enter a letter: l
 sorry there is no 'l' in the word.

      -------
    |/      |
    |      (_)
    |      \|/
    |       |
    |      / 
    | 
____|____

word:  i  n  -  a  n  -  e  -  -  e  n  t 
incorrect guesses left: 3

Enter a letter: p
 sorry there is no 'p' in the word.

      -------
    |/      |
    |      (_)
    |      \|/
    |       |
    |      / \ 
    | 
____|____

word:  i  n  -  a  n  -  e  -  -  e  n  t 
incorrect guesses left: 2

Enter a letter: r
 sorry there is no 'r' in the word.

      -------
    |/      |
    |      (_)
    |      \|/
    |       |
    |     _/ \ 
    | 
____|____

word:  i  n  -  a  n  -  e  -  -  e  n  t 
incorrect guesses left: 1

Enter a letter: f
 sorry there is no 'f' in the word.

      -------
    |/      |
    |      (_)
    |      \|/
    |       |
    |     _/ \_
    | 
____|____


Sorry, you didn't win this time.  The word was:  incandescent

Return to Lab 07
Example 1