The game would start off by asking the user if they were


Can someone right the code for Hangman in java. The game would start off by asking the user if they were playing 1 person or two person hangman. If the user said 1 person then the game would print the spaces for the words just like in hangman and ask the user to guess a letter.

Every time the user guessed incorrectly the game would subtract a life and add that letter to the list of incorrect letters guessed. Each time the user guessed the word right the game would print that letter in its corresponding spot.

For example it would start like this

Are you playing by yourself or two player?

user enters: 1

The game has generated a word for you. It has 8 spaces. Would you like to guess the word, or would you rather guess a letter? Enter word if you want to guess word and enter letter if you want to guess letter. ( It would print out this _ _ _ _ _ _ _ _ as well, this shows the 8 spaces for the letters that user will need to guess and gives them some visualization to go along with the game.)

(The secret word is JAZZLIKE, The game would also ask if the user would like to guess the full word before he guesses a letter each time. If he decides he wants to guess the full word and gets it wrong it would use his turn and take a life away)

user enters: 1

Please only enter single alphabetical letters

user enters: ok

Please only enter single alphabetical letters

user enters: E

The letter E is correct, you have 8 lives remaining. (The game would fill the spaces in the word it was using that had an E) ---> _ _ _ _ _ _ _ E

The code would continue untill the user lost all their lives and the game said game over or until the user had guessed all the letters correctly

Please make sure the code runs without any errors. Thank you

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: The game would start off by asking the user if they were
Reference No:- TGS02928271

Expected delivery within 24 Hours