Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please help with this intro to programming in C assignment ! Intro to Programming in C-Large Program 3 Hangman Game Assignment purpose: User defined functions,
please help with this intro to programming in C assignment !
Intro to Programming in C-Large Program 3 Hangman Game Assignment purpose: User defined functions, character arrays, c style string member functions 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 e o one for the word to be guessed (solution) o one for the word in progress (starword) o one for all of the guessed letters (letters) o one for the users word guess (guess) Declare additional variables as needed At the beginning of each game: . word to be guessed array - start with an empty string o Read a word from the file and store it in the word to be guessed array o 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 An integer will keep track of how many characters are in the array " HOW TO PLAY THE GAME 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 letter(s) in place and the user can input a word 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 incorrect guesses. The game is over when the word is guessed correctly 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 allo wed to play again without having to execute the program Helpful Hints Remember that the C language is case sensitive. For this program aA. 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 "hangman Words.txt" file to your project Intro to Programming in C-Large Program 3 Hangman Game Assignment purpose: User defined functions, character arrays, c style string member functions 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 e o one for the word to be guessed (solution) o one for the word in progress (starword) o one for all of the guessed letters (letters) o one for the users word guess (guess) Declare additional variables as needed At the beginning of each game: . word to be guessed array - start with an empty string o Read a word from the file and store it in the word to be guessed array o 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 An integer will keep track of how many characters are in the array " HOW TO PLAY THE GAME 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 letter(s) in place and the user can input a word 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 incorrect guesses. The game is over when the word is guessed correctly 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 allo wed to play again without having to execute the program Helpful Hints Remember that the C language is case sensitive. For this program aA. 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 "hangman Words.txt" file to your project
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