OUTPUT below **The target number is randomly created. The numbers below are user
ID: 3643858 • Letter: O
Question
OUTPUT below
**The target number is randomly created. The numbers below are user inputs.
How would I start coding this?
__________________
Your guess? 123
pica
Your guess? 456
pica
Your guess? 789
bagels
Your guess? 144
pica
Your guess? 155
pica
Your guess? 266
fermi pica
Your guess? 261
fermi fermi
Your guess? 661
You got it right in 8 guesses.
----------------------------------
Rules of the game...
"I'm thinking of a 3 digit number.
Each digit is between 1 and 9.
Try to guess my number, and I'll say "fermi"
for each digit you get right, and "pica"
for each correct digit in the wrong place."
Explanation / Answer
#include #include #include #include void game() { typedef std::string::size_type index; std::string symbols = "123456789123456789123456789"; unsigned int const selection_length = 3; std::random_shuffle(symbols.begin(), symbols.end()); std::string selection = symbols.substr(0, selection_length); std::string guess; int count = 0; while (std::coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.