Improving the user experience
This commit is contained in:
@@ -26,7 +26,84 @@ WORD_LIST = [
|
||||
"tortoise",
|
||||
]
|
||||
|
||||
## ASCII-art gallows, indexed by the number of lives left (0..MAX_LIVES).
|
||||
STAGES = [
|
||||
r"""
|
||||
+---+
|
||||
| |
|
||||
O |
|
||||
/|\ |
|
||||
/ \ |
|
||||
|
|
||||
=========""",
|
||||
r"""
|
||||
+---+
|
||||
| |
|
||||
O |
|
||||
/|\ |
|
||||
/ |
|
||||
|
|
||||
=========""",
|
||||
r"""
|
||||
+---+
|
||||
| |
|
||||
O |
|
||||
/|\ |
|
||||
|
|
||||
|
|
||||
=========""",
|
||||
r"""
|
||||
+---+
|
||||
| |
|
||||
O |
|
||||
/| |
|
||||
|
|
||||
|
|
||||
=========""",
|
||||
r"""
|
||||
+---+
|
||||
| |
|
||||
O |
|
||||
| |
|
||||
|
|
||||
|
|
||||
=========""",
|
||||
r"""
|
||||
+---+
|
||||
| |
|
||||
O |
|
||||
|
|
||||
|
|
||||
|
|
||||
=========""",
|
||||
r"""
|
||||
+---+
|
||||
| |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
=========""",
|
||||
]
|
||||
|
||||
## Message shown when the player wins.
|
||||
MSG_WIN = "You win!"
|
||||
## Message shown when the player loses (the word is appended).
|
||||
MSG_LOSE = "You lose. The word was: "
|
||||
|
||||
## ANSI escape code that resets all colors and styles.
|
||||
ANSI_RESET = "\033[0m"
|
||||
## ANSI escape code for bold text.
|
||||
ANSI_BOLD = "\033[1m"
|
||||
## ANSI escape code for red text.
|
||||
ANSI_RED = "\033[31m"
|
||||
|
||||
## ASCII-art title shown on start-up.
|
||||
TITLE_ART = r"""
|
||||
_ _
|
||||
| | | | __ _ _ __ __ _ _ __ ___ __ _ _ __
|
||||
| |_| |/ _` | '_ \ / _` | '_ ` _ \ / _` | '_ \
|
||||
| _ | (_| | | | | (_| | | | | | | (_| | | | |
|
||||
|_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_|
|
||||
|___/
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user