Help with MATLAB hangman game
Write an interactive program that plays the game Hangman. Use the random function to randomly select the word to guess out of the file provided. The player must guess the letters belonging to the word. The program should terminate when either all letters have been guessed correctly (player wins) or a specified number of incorrect guesses have been made (computer wins). Use a solution array to keep track of the solution so far. Initialize the array to a string of ‘’. Each time a letter in the word is guessed, replace the corresponding ‘’ with that letter.
- Each part of the program should be its own function. Such as recording the guess, keeping track of the solution, etc. (Hint: A menu might be a good way to do this.)
- Also – display on the screen what letters of the alphabet you have used so far and where you are in the solution.
- 6 incorrect guesses will be allowed.
- Use the data file of 80 words to select word to solve
You need to use functions and that is what slowing me down. any help would be appreciated
Posted Dec 2, 2011, 2:53 AM UTC · edited
22