Skip to content

A Python-based desktop Hangman game that uses real student data instead of dictionary words.

License

Notifications You must be signed in to change notification settings

vallabhatech/Hangman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎓 Hangman: Classmate Edition

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.


✨ Key Features

  • 🧩 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.json file, making it easy to update the class list without touching the code.


🛠️ Tech Stack

  • 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.

🚀 Installation & Usage

1. Prerequisites

Ensure you have Python installed. You can check by running:

python --version

2. Clone the Repository

git clone https://github.com/vallabhatech/Hangman.git
cd Hangman

3. Install Dependencies

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)

4. Setup Data

Ensure a file named students.json exists in the directory. It should follow this format:

{
    "23B81A0565": "GADDALA ABHILASH",
    "23B81A0566": "ANUPATI ABHINAV"
}

5. Run the Game

python app.py

🎮 How to Play

  1. Launch the App: The window will open with a clue (a student's name).
  2. Guess the ID: Click buttons or type keys to guess the roll number character by character.
  3. Watch your Lives: You have 6 tries. Every wrong guess draws a part of the hangman.
  4. Win or Lose:
  • Win: Complete the roll number before the drawing finishes.
  • Lose: The full hangman is drawn, and the correct ID is revealed.

🤝 Contributing

Contributions are welcome! If you want to add features like a timer, score tracking, or sound effects:

  1. Fork the project.
  2. Create your feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

👨‍💻 Author

Harivallabha Sai Surishetty


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A Python-based desktop Hangman game that uses real student data instead of dictionary words.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages