Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Output: This is a program that is similar to a hangman game. Given: There are 3 lives There is a word to guess General Algorithm:
Output: This is a program that is similar to a hangman game.
Given:
- There are 3 lives
- There is a word to guess
General Algorithm:
- When the game starts, the program welcomes first the player
- A character array should be predefined with a certain string/text
- The number of lives should be initialized
- Show to the player the string/text to be guessed using asterisks and the number of lives left
- Let the player input a letter (no numbers) to guess the string/text, one letter at a time
- Update to the player the string/text to be guessed
- revealing all the instances of that one letter guess if the letter is correct
- reduce the number of lives by one if the letter does not exist in the string/text
- Repeat the guessing mechanic once all asterisks are gone or there are no more lives left.
Use memcpy or memmove when revealing the correctly guessed characters. Do not use other string.h functions.
You can also make your own functions if you desire. You decide if you will use uppercase or lowercase letters. Do not include the spaces (' ').
Show the side-by-side interpretation of the algorithm to its corresponding code. Use only C programming.
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