- This is an application that mimics the famous childhood game, Hangman.
- You can try a fancier version of Hangman online: https://www.coolmathgames.com/0-hangman
- This is a Command Line Interface (CLI) application that allows the user to play the game.
- The game is coded in the context of Object Oriented Programing. Thus it has meaningful classes with meaningful attributes.
- The game follows an inheritance hierarchy model.
- Applied Exception Handling where necessary.
See below a sample class diagram shell:
When the player launches the app, he/she is presented with the following options:
- Start the game → lets player start the game
- View the rules of the game → See rules about how to play the game
All screens have descriptive messages and/or prompts.
Please note, to create a more realistic game, a menu appears as follows: Start the game View the rules of the game - Note: When a user views the rules of the game, there is an option that allows them to go back to the main menu. Exit the game
After the user hits the start game option he or she is presented with a menu listing the word categories. The user is required to select a category. Each category will indicate the type of words that the user would have to guess when they actually start to play the game. For example, if Sports is the category presented and the user chose sports as their category, then all the words generated by the game for the user to guess would revolve around Sports. Each category contains a bank of words (MINIMUM 5). Note: These were modelled using Arrays.
- Each category contains a bank of words (5 words per category). Note: The categories were modelled using Arrays.
- Each category has a minimum 5 words which are randomized at runtime.
- Each question represents a level. To win the game, the player must reach level 5 (ie: question 5); and, answer it correctly. Once you get “hung” at any level, you automatically lose the game.
- The app displays which level the player is currently on.
After the user selects the category that he or she wants to play, they should be presented with a display that indicates that they have started the game.
At each level, the game must randomly pull a word from the Category word bank for the user to guess.
When the game selects a word for the user to guess, the word should be represented using dashes (- symbol). For example: IRON MAN would be represented as: ---- --- PIZZA would be represented as: ----- SAMUEL L JACKSON would be represented as: ------ - -------
The user guesses the word by entering letters, one by one. The process is as follows: Enter a letter Game displays whether the word contains that letter If yes, then show what position in the word the letter appears If no, then let the user know Ask for another letter
Your game should display a “Letters Bank” section.
The Letters Bank Section represents the letters that have not been chosen and selected already.This should be displayed to the user at all times. Thus, when the game is initially run, the letters bank section would display all the letters from A to Z.
Once the user chooses a letter in the “Letters Bank” section, the said letter should be removed from the section.
If the user chooses a letter that is not in the “Letters Bank” section then the game should display an error message indicating that that specific word has already been chosen.
The user is only allowed to select letters that appear in the Letter Bank.
If the letter the user pressed is contained in the word that the game chose, then all occurrences of the letter should appear in the correct position of the word, on top of (or in replace of) the respective dashes.However, if the letter the user pressed is not contained in the word that the game chose, then the letter should appear in the “Incorrect Letters” section.
The “Incorrect Letters” section must display all the letters that were selected from the Letters Bank Section that did not match a letter in the word that the user is trying to guess.
In each level, the game should allow the user 10 chances to guess each word.
Every time the user chooses an incorrect letter in the word, their chances decrease as well as the game draws one element of the hanged man stick figure.
You may implement the graphics for these hangman images using simple text graphics. For example: https://gist.github.com/chrishorton/8510732aa9a80a03c829b09f12e20d9c
Once the user figures out the word presented at any level he or she will advance to the subsequent level.
Please ensure that you display the current level to the user.
The player loses the game if: They run out of chances; or They get “hung” in any level
After the player loses, display a YOU LOSE message and return the player to the main menu.
The player can only win the game if he or she correctly guesses the word of the last level. After the player wins, display a YOU WIN message, and return the player to the main menu.