Exercise 3. Hangman (Bonus) Write a program Hangman.java that emulates the game Hangman. The game is played as follows:
Posted: Mon May 09, 2022 6:17 am
Exercise 3. Hangman (Bonus) Write a program Hangman.java that emulates the game Hangman. The game is played as follows: to win the game, the user must guess a word letter-by-letter before exhausting the maximum number of guesses; The program must read the words to be guessed from the input file words.txt. It must also ask the user to enter the maximum number of guesses N allowed. The program must also keep track of the guessed and missed letters, and should discard already attempted guesses and misses). If the user guesses a letter that is repeated in the word, all the same) letters must be revealed to the user, and not just one. PS: when comparing letters, you should ignore case. Example: If the word is "test", a losing scenario: Enter the maximum number of guesses: 3 If the word is "test", a winning scenario: Enter the maximum number of guesses: 6 Word: Misses: Guess: r Word: Misses: Guess: r Word: Misses: r Guess: t Word: Misses: r Guess: T t Word: t Misses: r Guess: g t Word: t Misses: r Guess: r Word: t t Misses: rg Guess: e Word: te t Misses: rg Guess: e Word: t __t Misses: r Guess: p Word: tet Misses: rg Guess: s Word: t t Misses: rp Guess: 8 You Lost! The word was: test You Won! The word was: test