step 5
TirSystem/github-action: Sync GitHub mirror metadata / sync-metadata (push) Successful in 5s

Improving the user experience
This commit is contained in:
2026-10-04 12:46:03 +08:00
parent a76df46b79
commit 16cd9d42b9
6 changed files with 222 additions and 30 deletions
+77
View File
@@ -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"""
_ _
| | | | __ _ _ __ __ _ _ __ ___ __ _ _ __
| |_| |/ _` | '_ \ / _` | '_ ` _ \ / _` | '_ \
| _ | (_| | | | | (_| | | | | | | (_| | | | |
|_| |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_|
|___/
"""