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

Checking if the player has won
This commit is contained in:
2026-10-04 12:40:15 +08:00
parent 15d5f7134d
commit ce87f23314
6 changed files with 66 additions and 24 deletions
+7
View File
@@ -58,3 +58,10 @@ class Game:
@return For example `"p _ n g _ i n"`.
"""
return " ".join(c if c in self.guesses else BLANK for c in self.word)
@property
def won(self) -> bool:
"""!
@brief True when every letter of the word has been guessed.
"""
return all(c in self.guesses for c in self.word)