Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i need this done and can you make sure to have 8 functions like stated no global also Write an interactive program that will allow
i need this done and can you make sure to have 8 functions like stated no global also
Write an interactive program that will allow a user to play the game of Hangman. You will need to .You will use four character arrays: o o o o one for the word to be guessed (solution) one for the word in progress (starword) one for all of the guessed letters (letters) one for the users word guess (guess) Declare additional variables as needed At the beginning of each game: . . o word to be guessed array- start with an empty string. Read a word from the file and store it in the word to be guessed array. " word in progress array should be adjusted to the correct length (that is the same size as the word read from the file but consists only of (asterisks) in the beginning (starword) guessed letters array should be empty-a character is added with each guess o o An integer will keep track of how many characters are in the array . Allow the user to guess letters one character at a time. . At every stage of the game, the user should be able to view the current state of the word in progress (starword) and the list of guessed letters (letters) If any letter is correctly guessed the player is notified and the letter appears in its proper location in the word . in progress array (starword), this array is displayed again with the letters) in place and the user can input a word e If a letter is not correct, the number of used guesses is increased. .In ALL cases, the guessed letter should be added to the array of guessed letters The user is allowed up to 6 incorect guesses . The game is over when the word is guessed corrctly or the six incorrect guesses are used up. . If the player guesses the word correctly, the player is notified that they have won and the correct word is displayed. displayed. again. (The player will play again with the next word in the file) If the player does not get the correct word, the player is notified that they have lost and the correct word is . . When the game is over, the user should be allowed to play again without having to execute the program . Remember that the C language is case sensitive. For this programaA. In order to do this, you will need to convert all input letters to upper or lowercase either before or during the letter matching process. You will need to have a preprocessor directive to include the library file ctype.h in order to access these functions. Be sure to add the 'hangmanwords.txfile to your project .You must have meaningful variable and function names . You must use consistent and proper indentation . You must use sufficient comments that tell a programmer what is happening in the program . You must have at least 8 user-defined functions with meaningful names that perform the specified tasks Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started