These are the following images of the code that I wrote for this hangman game
We start of with the Java code and in the first few line we import the util Scanner for the user input.
We start off with the print of a greeting statement. Then we assign the boolean variable to be true. Our game is to guess the current guess of a word
We use a for loop to draw a picture of a hangman and add onto the hangman wheneverif the guess is not in the dictionary of the words that are provided. If the guess is the right, meaning the word is included in the dictionary document, then won't add onto the hangman, and will continue with the statement.
as you can see every time the letter in our guess is not the right letter in the word. We make a mistake, and our HANGMAN grows bigger.
Firstly starting with the head, second wrong letter gives the hangman a neck. Then one hand follows by another hand. And the game ends with the last leg.