Hangman Game is a Python program that allows users to play the classic word guessing game. Players try to guess a word by suggesting letters within a limited number of attempts.
- Play against another human or against the computer.
- Choose the number of rounds and hints before starting the game.
- View scores after each round.
- Clear screen and redraw UI after each turn.
- Human player can request a hint.
- Computer player's turn automatically triggered.
- Parse words from the Merriam-Webster website and allow user to approve them for addition to the game.
The project is structured as follows:
Hangman/
│
├── game.py # Main script to start the game
├── hangman_game.py # HangmanGame class definition
├── player.py # Player and ComputerPlayer class definitions
├── file_handler.py # FileHandler class for file operations
├── suggest_words.py # Script to parse words from website and suggest for addition
├── words.txt # Text file containing words for the game
└── README.md # Project documentation in Markdown format
- Run
game.py
to start the game. - Follow the on-screen instructions to play the game.
- Python 3.x
- BeautifulSoup (for parsing website)
- Requests (for making HTTP requests)
- Clone the repository to your local machine.
- Install the required dependencies using pip:
pip install beautifulsoup4 requests