These are the instructions. How do I include all of the requirements below. *My program is listed beneath the instructions.
________________________________________________________________________________
You'll ask the user to enter a secret word or phrase, a 100 char array
Any letter that gets entered will be replaced with a "*"
Spaces will be represented with a "_"
Any other character will be left alone.
Please enter a secret word or phrase:
>hello world
The secret word is: *****_*****
Next, the user will be asked to guess a letter. If the letter is found in the secret word, that letter will be displayed:
Enter your guess:
>l
The letter was found!
The secret word is: **ll*_***l*
Guessed Letters: l
For every correct guess, the letter in the proper place will be revealed.
For every wrong guess, a body part of the hangman will be printed out:
head
head - body
head - body - left arm
head - body - left arm - right arm
head - body - left arm - right arm - left leg
head - body - left arm - right arm - left leg - right leg - HANGMAN!
Requirements:
You need to keep track of previously guessed letters, so the user will not guess the same letter twice.
You will have a function that takes a char array and returns a char array of *'s of the same length as the original char array
You will have a function that takes a char and a char array, and checks to see if that char is in the char array
You will probably also want a function that will display that reveals the hidden letter with a correct guess
You may also want a function that keeps track of guessed letters
and also a function that determines the state of the hangman, if the user fails to guess the word before "HANGMAN!", display the word.
________________________________________________________________________________
More instructions:
1. To make it easier, first how do I make the program hide the word entered by player1 and replace it with * or _ for letters and spaces.
2. When I run the program, it says that guess is not initialized, how do I fix that.
3. How do I fix this program so that it continually lets the user guess until they use all 6 of their try's.