Skip to content

[Bug] Hangman never displays the final gallows stage on a loss (HANGMAN_STAGES[6] dead) #1871

Description

@vedant7007

Problem (Low — final stage never shown)

games/Hangman-Game/Hangman-Game.py:170 (loop guard at :161) — the stage art is printed at the top of the loop using the current attempts. After the 6th wrong guess attempts becomes 6, while attempts < max_attempts fails, and the loop exits before ever printing HANGMAN_STAGES[6] (the fully-hanged figure). On a full loss the player only sees the 5-limb drawing; HANGMAN_STAGES[6] is effectively dead code.

Suggested fix (tiny)

Print HANGMAN_STAGES[min(attempts, 6)] in the game-over branch before the banner.

Happy to fix under GSSoC '26 if assigned.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions