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

Keeping track of the player's lives
This commit is contained in:
2026-10-04 12:41:43 +08:00
parent ce87f23314
commit a76df46b79
6 changed files with 91 additions and 38 deletions
+29 -25
View File
@@ -1,28 +1,32 @@
"""!
@file constants.py
@brief Constants shared across the Hangman game.
"""
## Character shown for a letter that has not been guessed yet.
BLANK = "_"
## Words the computer picks from.
WORD_LIST = [
"aardvark",
"baboon",
"camel",
"dolphin",
"elephant",
"flamingo",
"giraffe",
"hedgehog",
"iguana",
"kangaroo",
"leopard",
"octopus",
"penguin",
"squirrel",
"tortoise",
]
"""!
@file constants.py
@brief Constants shared across the Hangman game.
"""
## Number of wrong guesses the player may make before losing.
MAX_LIVES = 6
## Character shown for a letter that has not been guessed yet.
BLANK = "_"
## Words the computer picks from.
WORD_LIST = [
"aardvark",
"baboon",
"camel",
"dolphin",
"elephant",
"flamingo",
"giraffe",
"hedgehog",
"iguana",
"kangaroo",
"leopard",
"octopus",
"penguin",
"squirrel",
"tortoise",
]
## 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: "