A unique twist on the classic Hangman game built with Python and Tkinter. Instead of guessing random dictionary words, players must identify student roll numbers (IDs) using their names as clues.
-
🧩 Logic Twist: Guess alphanumeric roll numbers (e.g.,
23B81A0565) instead of standard words. -
👤 Identity Clues: The game displays a specific student's name as the hint for every round.
-
⚡ Non-Blocking UI: The background image downloads in a separate thread, ensuring the game launches instantly without freezing.
-
🎨 Dynamic Visuals:
-
Live Drawing: The stick figure is drawn part-by-part on a canvas upon every wrong guess.
-
Responsive Background: The background image automatically resizes to fit the window.
-
⌨️ Full Keyboard Support: Play using on-screen buttons or your physical keyboard.
-
🛡️ Input Protection: Prevents duplicate guesses and penalizing players for double-tapping keys.
-
📂 External Data: Student data is loaded from a
students.jsonfile, making it easy to update the class list without touching the code.
- Python 3.x: Core logic.
- Tkinter: Standard GUI framework for the interface.
- Pillow (PIL): Advanced image handling for the background.
- Requests: To fetch assets dynamically from the web.
- Threading: For asynchronous background loading.
- JSON: For structured data management.
Ensure you have Python installed. You can check by running:
python --version
git clone https://github.com/vallabhatech/Hangman.git
cd Hangman
This project requires Pillow and requests. Install them via pip:
pip install Pillow requests
(Or simply run pip install -r requirements.txt if you have added one)
Ensure a file named students.json exists in the directory. It should follow this format:
{
"23B81A0565": "GADDALA ABHILASH",
"23B81A0566": "ANUPATI ABHINAV"
}
python app.py
- Launch the App: The window will open with a clue (a student's name).
- Guess the ID: Click buttons or type keys to guess the roll number character by character.
- Watch your Lives: You have 6 tries. Every wrong guess draws a part of the hangman.
- Win or Lose:
- Win: Complete the roll number before the drawing finishes.
- Lose: The full hangman is drawn, and the correct ID is revealed.
Contributions are welcome! If you want to add features like a timer, score tracking, or sound effects:
- Fork the project.
- Create your feature branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Harivallabha Sai Surishetty
- GitHub: @vallabhatech
This project is licensed under the MIT License - see the LICENSE file for details.