Hangman is a Python terminal game, wich runs in the Code Institue mock terminal on Heroku.
The Hangman game is about guessing letters (A-Z) to form the words. If the player guesses the right letter that is within the word, the letter appears in its correct position. The user has to guess the correct word until a man is hung, then the game is over. It has 3 python files, run.py, word.py and hangman_structure.py
The live link can be found here Emmas hangman
The game features a welcome message for the user. To start the game, the user needs to enter their name. The name must be letters only. If the user puts a number, an error message will appear. It says "Username must be alphabet only".
After they write down their name on the console, a welcome text will appear. After, a hint will appear about how many letters are in the word. Also, a picture of a hanging but no figure yet. Write a letter! If the letter guessed by the user matches any of the letters in the word, the letter will appear in the blank line.
If the letter guessed is wrong, the hangingman figure will display piece by piece. And also a text will be displayed to the user " Oh no, letter (?) is not in the word", with red color. "Type a letter" will be displayed again.
If the user types in a letter that has already been chosen for the wrong attempt, the following message will appear: "You already guessed it, please try again...".
If the user is unable to figure out the word in 6 attempts, the hangman will appear completed and the user loses the game. The correct answer will be displayed to the user. A text will be shown "Want to play again (type yes or no):". If the user writes no, then the game will quit.
If the user guessed the correct letters to the word, a text will be shown "Congratulations!!, It's correct".And here the users can choose if the want to play again or quit. to write yes or no to the terminal.
- I would like to add a scoreboard with the name of the player and correct or wrong words they have played hangman with.
Planning of this project was based on the flow charts using the platform Lucid Charts.
- Tested for various bugs and functionality.
- tested for all scenarios with invalid guesses.
- Tested fpr all scenarios with successfull guesses.
- This game where only tested in crome, safari and firefox on a mac laptop divece.
- Since the Pep8Online website is not working properly right now. I added the pep8 validation into my gitpod workspace directly.
- All errors and warnings were fixed, except for 'ms-toolsai.jupyter'. These will not affect the game, so i chose to leave them as they are. you can se them below.
- Problems with getting exit to work. after google alot i found out that i needed to import sys to get it to work.
- I wanted to get to play again to work, that a user could type y and n if they wanted to continue playing. I was stuck for quite a while with how it would work. The problem was that I kept insisting that there would be functions within functions (). But then I realized that I had to wrap all functions in one function to get it to loop.
- No unfixed bugs
- Fork or clone this repository.
- requirements.txt can be left empty as this project does not use any external libraries.
- Create a new app in Heroku.
- Select "New" and "Create new app".
- Name the new app and click "Create new App".
- In "settings" select "BuildPack" and select Python and Node.js.
- While still in "settings", click "reveal Config Vars" and input the following KEY: PORT,VALUE:8000.
- Click on "Deploy" an select your deploy method and repository.
- Click "Connect" on selected repository.
- Choose "Deploy Branch" in the manual deploy section.
- You can choose "Enable Automatic Deploys" if you want.
- Heroku will now deploy the site.
- Python
- Github
- Git
- Gitpod
- Heroku
- For tutorial on hangman Kylie Ying
- For tutorial on hangman Tech with Mike
- Extra help with if/else Stackoverflow
- welcome text idees tds
- How to play hangmanIt sorcecode
- json wordlist, over 2,465 words stackoverflor
- To understand how to get color to text stackoverflow
I want to say tank you to my mentor Jubril for the guidance and support. and giving me feedback to improve. And ofcourse Code Institute slack community.