In: Computer Science
MATLAB
Program a Matlab version of Guess the Word. The word should be
determined by user input.
Once the word is determined, the game should begin by displaying
blanks (-) where
all the letters of the word are. The game should then continue to
prompt the player to
guess a letter in the word. If the player guesses a letter that is
in the word and not
already displayed, that letter should be displayed everywhere it
appears in the word.
If the player guesses a letter that is not in the word or a letter
that is in the word
but has been guessed before, one try should be added. This should
continue until the player completes either the word or until they
have reached 6 tries, at which point the game should end which the
message: "You ran out of tries and lost."
MATLAB CODE:
SAMPLE OUTPUT: