Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi. i wanted to write program that prompts for string words.It then allows the player to guess the characters in string of words.It keeps track
Hi. i wanted to write program that prompts for string words.It then allows the player to guess the characters in string of words.It keeps track of characters guessed and tells the player when he wins.
As an example let me show you how the output should look like
Please enter a string of words. the string is good Original string: the string is good Guessed string: jQuery224043447915556307914_1585068546809???????????????? Characters to choose from: abcdefghijklmnopqrstuvwxyz Please guess a character. t Character read: t Original string: the string is good Guessed string: t????t???????????? Characters to choose from: abcdefghijklmnopqrs uvwxyz Please guess a character. s Character read: s Original string: the string is good Guessed string: t???st??????s????? Characters to choose from: abcdefghijklmnopqr uvwxyz Please guess a character. r Character read: r Original string: the string is good Guessed string: t???str?????s????? Characters to choose from: abcdefghijklmnopq uvwxyz Please guess a character. g Character read: g Original string: the string is good Guessed string: t???str??g??s?g??? Characters to choose from: abcdef hijklmnopq uvwxyz Please guess a character. o Character read: o Original string: the string is good Guessed string: t???str??g??s?goo? Characters to choose from: abcdef hijklmn pq uvwxyz Please guess a character. t Character read: t Original string: the string is good Guessed string: t???str??g??s?goo? Characters to choose from: abcdef hijklmn pq uvwxyz Please guess a character. e Character read: e Original string: the string is good Guessed string: t?e?str??g??s?goo? Characters to choose from: abcd f hijklmn pq uvwxyz Please guess a character. Character read: Original string: the string is good Guessed string: t?e str??g ?s goo? Characters to choose from: abcd f hijklmn pq uvwxyz Please guess a character. i Character read: i Original string: the string is good Guessed string: t?e stri?g is goo? Characters to choose from: abcd f h jklmn pq uvwxyz Please guess a character. n Character read: n Original string: the string is good Guessed string: t?e string is goo? Characters to choose from: abcd f h jklm pq uvwxyz Please guess a character. d Character read: d Original string: the string is good Guessed string: t?e string is good Characters to choose from: abc f h jklm pq uvwxyz Please guess a character. h Character read: h Original string: the string is good Guessed string: the string is good Characters to choose from: abc f jklm pq uvwxyz Congratulations! You guessed it! Would you like to play again? (yes/no) yes Please enter a string of words. This is fun Original string: this is fun Guessed string: ??????????? Characters to choose from: abcdefghijklmnopqrstuvwxyz Please guess a character. t Character read: t Original string: this is fun Guessed string: t?????????? Characters to choose from: abcdefghijklmnopqrs uvwxyz Please guess a character. f Character read: f Original string: this is fun Guessed string: t???????f?? Characters to choose from: abcde ghijklmnopqrs uvwxyz Please guess a character. u Character read: u Original string: this is fun Guessed string: t???????fu? Characters to choose from: abcde ghijklmnopqrs vwxyz Please guess a character. h Character read: h Original string: this is fun Guessed string: th??????fu? Characters to choose from: abcde g ijklmnopqrs vwxyz Please guess a character. i Character read: i Original string: this is fun Guessed string: thi??i??fu? Characters to choose from: abcde g jklmnopqrs vwxyz Please guess a character. n Character read: n Original string: this is fun Guessed string: thi??i??fun Characters to choose from: abcde g jklm opqrs vwxyz Please guess a character. Character read: Original string: this is fun Guessed string: thi? i? fun Characters to choose from: abcde g jklm opqrs vwxyz Please guess a character. s Character read: s Original string: this is fun Guessed string: this is fun Characters to choose from: abcde g jklm opqr vwxyz Congratulations! You guessed it!
I am still in low level so try using strings and loops only to solve the program
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