Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me with creating a hangman game by c++ Details 1. Use a header file to declare your functions. Name your header file hangman.h
Please help me with creating a hangman game by c++
Details 1. Use a header file to declare your functions. Name your header file "hangman.h" 2. Use a source file to define the body of each function. Name your source file "hangman.cpp" 3. Create your main method (where the game is actually played) inside source file called "main.cpp" Hangman Functions: Implement each of the functions as described below: 1. void showGallows ( int guessLimit ) Receives a guess limit as a parameter Draw correct ASCII art to the console window dependent on the number of incorrect guesses. Example: If one letter is incorrectly guessed, show the hangman's head. When 2 letters have been incorrectly guessed, show the head and body. On the 3r9 wrong guess, draw the left arm, etc. See below for full gallows. 2. void showSolved( char word[], char guesses [] ) store properly guessed letters in an array show the user which letters have been correctly guessed . 3. int main() create three C-style strings: the word-to-be-guessed, correctly guessed letters, and incorrectly guessed letters. introduce the game to the user call showGallows() and showSolved() ask the user for a letter: o If the word-to-be-guessed contains that letter, print out the word and ask for another letter o If the word-to-be-guessed does not contain the letter (aka an incorrect guess), add one body part to the hangman if the user has gone over the guess limit (aka the gallows is full), end the game o display the gallows to the user o 3 letters left to guess. What letter do you guess next? i Guess: i 0 / Wrong guesses: hrtv Word to solve: cla_ical 2 letters left to guess. What letter do you guess next? d Guess: d 1 0 /11 Wrong guesses: hrtvd Word to solve: cla ical 2 letters left to guess. What letter do you guess next? s Guess: s 0 /11 Wrong guesses: hrtvd Word to solve: classical o letters left to guess. You winStep 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