Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task: Write a program to play hangman. In hangman, one player thinks of a word and the other tries to guess the word by guessing
Task: Write a program to play hangman. In hangman, one player thinks of a word and the other tries to guess the word by guessing one letter at a time. The guesser is allowed a fixed number of missed letters such as six; if the word is not guessed before six misses, the guesser loses. Hint: To read an input character, use this C snippet: char letter; printf("enter a letter: "); scanf(" %c", &letter); printf( "You've entered the letter %c ", letter); The prototypes for the printf () and scanf() C Standard Library functions are defined in the header file. Deliverables: A file named hangman.c containing the C source code. Input/Output: Use the following sample as a guideline: Welcome to Hangman! Try to guess the secret word one letter at a time. # misses left 6 enter a letter: E # misses left 6 enter a letter: A # misses left 5 enter a letter: I # misses left -4 enter a letter: R # misses left 4 enter a letter: 0 # misses left 3 enter a letter: N # misses left 3 enter a letter: T # misses left 3 enter a letter: L # misses left 2 enter a letter: U # misses left 1 enter a letter: P YOU LOSE! The word is STRENGTHEN word* wordEE word = * * * E * * * * E * wordE E word = * * R E * * * * E * word = * * R E * * * * E * wordREN*E N word = * T R E N * T * EN word TRENTE N word = * T R E N * T * EN
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