Skip to content

Commit 912ce55

Browse files
Merge branch 'main' into main
2 parents 755cec3 + 469fe69 commit 912ce55

2 files changed

Lines changed: 2945 additions & 4100 deletions

File tree

games/Hangman-Game/Hangman-Game.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,65 @@
2222

2323
from utils.banners import print_victory_banner, print_game_over_banner
2424

25+
HANGMAN_STAGES = [
26+
"""
27+
-----
28+
| |
29+
|
30+
|
31+
|
32+
|
33+
""",
34+
"""
35+
-----
36+
| |
37+
| O
38+
|
39+
|
40+
|
41+
""",
42+
"""
43+
-----
44+
| |
45+
| O
46+
| |
47+
|
48+
|
49+
""",
50+
"""
51+
-----
52+
| |
53+
| O
54+
| /|
55+
|
56+
|
57+
""",
58+
"""
59+
-----
60+
| |
61+
| O
62+
| /|\\
63+
|
64+
|
65+
""",
66+
"""
67+
-----
68+
| |
69+
| O
70+
| /|\\
71+
| /
72+
|
73+
""",
74+
"""
75+
-----
76+
| |
77+
| O
78+
| /|\\
79+
| / \\
80+
|
81+
""",
82+
]
83+
2584
def main():
2685
# Cleaned up global variables (not strictly necessary unless modifying in nested scopes, but kept for your structure)
2786
global all_guessed, attempts, correct_letters, display, guess, guessed_letters, hint, letter, max_attempts, selected, won, word, word_data, word_length
@@ -108,6 +167,7 @@ def main():
108167
else:
109168
display += "_ "
110169

170+
print(HANGMAN_STAGES[attempts])
111171
print(f"Word: {display}")
112172

113173
# 2. CHECK WIN CONDITION HERE BEFORE ASKING FOR A NEW GUESS

0 commit comments

Comments
 (0)