Lab 8: Example Output
Here are four runs of a working program, 2 without ascii animation, and 2 with. Note error handling of bad input values, and out reguessing a letter is handled.
With Ascii Drawing: loses
% python3 melty.py
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This program plays a game of Melty.
Guess letters in the mystery word.
You can only make 8 incorrect guesses before
Melty melts. See if you can save Melty and
guess the word before you run out of guesses.
Good Luck!
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-----
| |
-----------
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - - - - - -
incorrect guesses left: 8
Enter a letter: e
sorry there is no 'e' in the word.
-----
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - - - - - -
incorrect guesses left: 7
Enter a letter: r
sorry there is no 'r' in the word.
-----
| * * |
| o |
-------
\ | | /
-------| |-------
/ | | \
------------
| |
| |
------------
word: - - - - - -
incorrect guesses left: 6
Enter a letter: m
sorry there is no 'm' in the word.
-----
| * * |
| o |
-------
\ | |
-------| |
/ | |
------------
| |
| |
------------
word: - - - - - -
incorrect guesses left: 5
Enter a letter: M
you already guessed 'm', try again...
Enter a letter: 8
hey, '8' isn't an alphabetic character, try again...
Enter a letter: hello
hey, 'hello' isn't an alphabetic character, try again...
Enter a letter: r
you already guessed 'r', try again...
Enter a letter: s
sorry there is no 's' in the word.
-----
| * * |
| o |
-------
| |
| |
| |
------------
| |
| |
------------
word: - - - - - -
incorrect guesses left: 4
Enter a letter: a
good guess, 'a' is in the word.
-----
| * * |
| o |
-------
| |
| |
| |
------------
| |
| |
------------
word: a - - - - -
incorrect guesses left: 4
Enter a letter: i
sorry there is no 'i' in the word.
-----
| * * |
| o |
-------
| |
| |
| |
---------
word: a - - - - -
incorrect guesses left: 3
Enter a letter: o
good guess, 'o' is in the word.
-----
| * * |
| o |
-------
| |
| |
| |
---------
word: a - o - - -
incorrect guesses left: 3
Enter a letter: u
good guess, 'u' is in the word.
-----
| * * |
| o |
-------
| |
| |
| |
---------
word: a - o u - -
incorrect guesses left: 3
Enter a letter: r
you already guessed 'r', try again...
Enter a letter: m
you already guessed 'm', try again...
Enter a letter: p
sorry there is no 'p' in the word.
-----
| * * |
| o |
-----
word: a - o u - -
incorrect guesses left: 2
Enter a letter: q
sorry there is no 'q' in the word.
-----
| |
| |
-----
word: a - o u - -
incorrect guesses left: 1
Enter a letter: v
sorry there is no 'v' in the word.
... I've melted! :(
Sorry, Melty melted. The word was: abound. Better luck next time!
With Ascii Drawing: wins
% python melty.py
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This program plays a game of Melty.
Guess letters in the mystery word.
You can only make 8 incorrect guesses before
Melty melts. See if you can save Melty and
guess the word before you run out of guesses.
Good Luck!
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
-----
| |
-----------
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - - - - - - - - - -
incorrect guesses left: 8
Enter a letter: e
good guess, 'e' is in the word.
-----
| |
-----------
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - - e - - - - - - -
incorrect guesses left: 8
Enter a letter: a
good guess, 'a' is in the word.
-----
| |
-----------
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - - e - a - - - - -
incorrect guesses left: 8
Enter a letter: i
good guess, 'i' is in the word.
-----
| |
-----------
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - - e - a - i - - -
incorrect guesses left: 8
Enter a letter: o
good guess, 'o' is in the word.
-----
| |
-----------
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - - e - a - i o - -
incorrect guesses left: 8
Enter a letter: u
good guess, 'u' is in the word.
-----
| |
-----------
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - - e - a - i o u -
incorrect guesses left: 8
Enter a letter: s
good guess, 's' is in the word.
-----
| |
-----------
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - - e - a - i o u s
incorrect guesses left: 8
Enter a letter: t
sorry there is no 't' in the word.
-----
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - - e - a - i o u s
incorrect guesses left: 7
Enter a letter: r
good guess, 'r' is in the word.
-----
| * * |
| o |
-------
\ | x | /
-------| x |-------
/ | x | \
------------
| |
| |
------------
word: - r e - a r i o u s
incorrect guesses left: 7
Enter a letter: n
sorry there is no 'n' in the word.
-----
| * * |
| o |
-------
\ | | /
-------| |-------
/ | | \
------------
| |
| |
------------
word: - r e - a r i o u s
incorrect guesses left: 6
Enter a letter: f
sorry there is no 'f' in the word.
-----
| * * |
| o |
-------
\ | |
-------| |
/ | |
------------
| |
| |
------------
word: - r e - a r i o u s
incorrect guesses left: 5
Enter a letter: t
you already guessed 't', try again...
Enter a letter: c
good guess, 'c' is in the word.
-----
| * * |
| o |
-------
\ | |
-------| |
/ | |
------------
| |
| |
------------
word: - r e c a r i o u s
incorrect guesses left: 5
Enter a letter: p
good guess, 'p' is in the word.
-----
| * * |
| o |
-------
\ | |
-------| |
/ | |
------------
| |
| |
------------
You won!!! The word was precarious. You saved Melty!
Without Drawing: loses
% python3 melty.py
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This program plays a game of Melty.
Guess letters in the mystery word.
You can only make 8 incorrect guesses before
Melty melts. See if you can save Melty and
guess the word before you run out of guesses.
Good Luck!
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
word: - - - - - - -
incorrect guesses left: 8
Enter a letter: e
good guess, 'e' is in the word.
word: - - - - e - -
incorrect guesses left: 8
Enter a letter: E
you already guessed 'e', try again...
Enter a letter: h
good guess, 'h' is in the word.
word: - h - - e - -
incorrect guesses left: 8
Enter a letter: 9
hey, '9' isn't an alphabetic character, try again...
Enter a letter: helo
hey, 'helo' isn't an alphabetic character, try again...
Enter a letter: google
hey, 'google' isn't an alphabetic character, try again...
Enter a letter: b
sorry there is no 'b' in the word.
word: - h - - e - -
incorrect guesses left: 7
Enter a letter: c
good guess, 'c' is in the word.
word: c h - - e - -
incorrect guesses left: 7
Enter a letter: d
sorry there is no 'd' in the word.
word: c h - - e - -
incorrect guesses left: 6
Enter a letter: e
you already guessed 'e', try again...
Enter a letter: f
sorry there is no 'f' in the word.
word: c h - - e - -
incorrect guesses left: 5
Enter a letter: g
sorry there is no 'g' in the word.
word: c h - - e - -
incorrect guesses left: 4
Enter a letter: h
you already guessed 'h', try again...
Enter a letter: i
good guess, 'i' is in the word.
word: c h i - e - -
incorrect guesses left: 4
Enter a letter: j
sorry there is no 'j' in the word.
word: c h i - e - -
incorrect guesses left: 3
Enter a letter: k
sorry there is no 'k' in the word.
word: c h i - e - -
incorrect guesses left: 2
Enter a letter: l
sorry there is no 'l' in the word.
word: c h i - e - -
incorrect guesses left: 1
Enter a letter: m
good guess, 'm' is in the word.
word: c h i m e - -
incorrect guesses left: 1
Enter a letter: n
sorry there is no 'n' in the word.
Sorry, Melty melted. The word was: chimera. Better luck next time!
Without Drawing: wins
% python3 melty.py
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This program plays a game of Melty.
Guess letters in the mystery word.
You can only make 8 incorrect guesses before
Melty melts. See if you can save Melty and
guess the word before you run out of guesses.
Good Luck!
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
word: - - - - - -
incorrect guesses left: 8
Enter a letter: e
sorry there is no 'e' in the word.
word: - - - - - -
incorrect guesses left: 7
Enter a letter: E
You already guessed 'e', try again...
Enter a letter: i
good guess, 'i' is in the word.
word: - i - - - -
incorrect guesses left: 7
Enter a letter: a
good guess, 'a' is in the word.
word: - i - - a -
incorrect guesses left: 7
Enter a letter: o
sorry there is no 'o' in the word.
word: - i - - a -
incorrect guesses left: 6
Enter a letter: s
good guess, 's' is in the word.
word: - i s - a -
incorrect guesses left: 6
Enter a letter: n
sorry there is no 'n' in the word.
word: - i s - a -
incorrect guesses left: 5
Enter a letter: t
sorry there is no 't' in the word.
word: - i s - a -
incorrect guesses left: 4
Enter a letter: w
sorry there is no 'w' in the word.
word: - i s - a -
incorrect guesses left: 3
Enter a letter: m
good guess, 'm' is in the word.
word: - i s m a -
incorrect guesses left: 3
Enter a letter: y
sorry there is no 'y' in the word.
word: - i s m a -
incorrect guesses left: 2
Enter a letter: d
good guess, 'd' is in the word.
word: d i s m a -
incorrect guesses left: 2
Enter a letter: l
good guess, 'l' is in the word.
You won!!! The word was dismal. You saved Melty!