I have no idea how to do this. Please help.
This week's lab is to design a hangman game. Your program should be able to open a text file which contains a list of words (one word on each line of the text file) and read the words into a list to contain all of the possible words.
Your program should then prompt the user to play a game, please provide at least 3 difficultly levels for the user to choose from. (Difficulty applies to the number of wrong answers allowed before the user loses the game)
Once the user has selected a difficulty, a word from the word list should be chosen randomly using python's random library (example of how to use random at bottom of assignment page).
The program should then display stars to screen so the user knows how many letters are in the word (I suggest making a list of stars). Then the user should be prompted for a guess. After each guess, the program should determine if the guess is valid (ie, it should check to see if the guess has been used before....This means you will need to keep track of what letters have been guessed). If the guess is invalid, a message should be displayed telling the user that they have already guessed that letter and prompting the user to try another letter. If the guess is valid, the program should check to see if the letter is in the word.
If the letter is in the word, the list containing stars should be updated so that correct letters are displayed where required. If the letter is not in the word, then the user should be credited with an incorrect guess.
After the guess has been evaluated, a hangman picture should be displayed (based on number of wrong answers and difficulty level...You may use ASCII art or turtle graphics for the picture), the list of incorrect guesses, and current status of the word. The pattern of guessing should continue until the user is able to correctly solve the puzzle, or is "hung" (runs out of incorrect guesses).
Once the game is complete, the user should be asked if they wish to play again. Example of a working hangman game to be demonstrated in lab.