Skip to content

fix : reset WORDS_BY_LENGTH dictionary before building in Reverse-Hangman - #1882

Open
tmdeveloper007 wants to merge 1 commit into
steam-bell-92:mainfrom
tmdeveloper007:#1876
Open

fix : reset WORDS_BY_LENGTH dictionary before building in Reverse-Hangman#1882
tmdeveloper007 wants to merge 1 commit into
steam-bell-92:mainfrom
tmdeveloper007:#1876

Conversation

@tmdeveloper007

Copy link
Copy Markdown
Contributor

Summary of What Has Been Done

Fixed the WORDS_BY_LENGTH accumulation bug in games/Reverse-Hangman-Game/Reverse-Hangman-Game.py. The dictionary was a module-level global that accumulated duplicate entries across multiple main() calls because it was never cleared before repopulating.

Changes Made

  • games/Reverse-Hangman-Game/Reverse-Hangman-Game.py: Added WORDS_BY_LENGTH.clear() at the start of main() before the dictionary population loop.

Impact it Made

The AI in Reverse-Hangman now always has correct word sets regardless of how many times main() is invoked, preventing duplicate word entries from causing unpredictable AI behavior.

Note: Please assign this PR to the tmdeveloper007 account.

@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

@tmdeveloper007 is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant