Add reverse hangman game - #92
Conversation
Yugo206
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
The game works and the idea is interesting. Before merging, I have one question about the gameplay:
Currently, when the program asks whether a letter is in the word, the player only answers “y” or “n”. This means the program never learns the positions of the letters, which is usually an important part of Reverse Hangman.
Was this a deliberate design choice, or would you consider extending it so the player can provide letter positions as well?
I’d like to hear your thoughts before merging.
|
Thanks for the feedback — that is a good point. The original I’ll update the game so that when the player confirms a letter is present, they can enter all matching positions. The game will then retain only words where that letter occurs in exactly those positions. I’ll also update the instructions and add validation for the position input. |
|
Implemented the requested update in the latest commit. The game now asks for all 1-based positions when a guessed letter is present and filters candidates by the exact occurrences. I also added input validation and updated the instructions. |
Yugo206
left a comment
There was a problem hiding this comment.
Thanks for the update! The position-based system is a great improvement and makes the game much closer to a true Reverse Hangman.
The only remaining issue is that the CI is failing because the project does not allow if name == "main" blocks. The launcher automatically discovers and runs games through the run() function.
Could you remove:
if name == "main":
run()
and push a small follow-up commit? Once that’s fixed, this looks good to me.
|
I have removed the: if name == "main": Please review once again we are good to go. |
|
Everything is ready. |
|
Thank you!! |
Description
Added a new logic game: Reverse Hangman.
In this game, the player thinks of a secret word and the computer attempts to guess it by proposing letters. The player responds only with:
yif the letter is in the wordnif the letter is not in the wordThe game uses a simple dictionary-based approach and letter-frequency analysis to narrow down possible candidate words.
Checklist
AUTHORvariablerun()functionrun()at the end of the fileif __name__ == "__main__".pycfiles.DS_Storefileslauncher.pyIssue
Closes #84