Answered step by step
Verified Expert Solution
Link Copied!

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:

  1. When the game starts, the program welcomes first the player
  2. A character array should be predefined with a certain string/text
  3. The number of lives should be initialized
  4. Show to the player the string/text to be guessed using asterisks and the number of lives left
  5. Let the player input a letter (no numbers) to guess the string/text, one letter at a time
  6. Update to the player the string/text to be guessed
    1. revealing all the instances of that one letter guess if the letter is correct
    2. reduce the number of lives by one if the letter does not exist in the string/text
  7. 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David J. Auer David M. Kroenke

13th Edition

B01366W6DS, 978-0133058352

More Books

Students also viewed these Databases questions

Question

Question What is a Roth 403 (b) plan?

Answered: 1 week ago

Question

Question Can a Keogh plan fund be reached by the owners creditors?

Answered: 1 week ago