Hangman Game is a terminal-based game implemented in Python. It allows players to guess letters to uncover a hidden word, with each incorrect guess leading to the drawing of a hangman. The word to be guessed is randomly chosen from a list of movies sourced from IMDb's top 100 movies list (as of August 2022).
The game consists of a main function and four other subprograms/functions: select_movie
, question
, game
, and get_result
. These functions are called from the main function in the respective order to control the flow of the game.
- The project must be implemented in Python.
- It should have a main function and at least three other functions, each accompanied by tests that can be executed with pytest.
- The main function should be in a file called
project.py
, located in the root folder of the project. - The three required custom functions (other than the main function) should also be in
project.py
and defined at the same indentation level as the main function. - The test functions should be in a file called
test_project.py
, also located in the root folder of the project. The test functions should have the same name as the custom functions, prepended withtest_
. - Additional classes and functions can be implemented as desired.
- Any pip-installable libraries required by the project should be listed, one per line, in a file called
requirements.txt
in the root of the project.
- Clone the repository:
git clone https://github.com/aviiciii/hangman-game.git
- Install the required dependencies using pip:
pip install -r requirements.txt
- Run the game by executing
project.py
in the terminal:python project.py
- Follow the prompts to play the game and guess the hidden word.
- Have fun playing Hangman!
Contributions to this repository are generally not accepted, as the project was developed as part of a course assignment. However, if you have suggestions or improvements specific to this project, feel free to open an issue or submit a pull request. Your feedback can help enhance the game and improve the user experience.
This project is licensed under the MIT License. Please see the LICENSE file for more information.
Enjoy playing Hangman and challenge yourself to guess the hidden words!