Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
A secret number is . The player types , then , then . What does the game show?
A while loop asks again until the answer is right.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, compare your working with the solution.
Plan. The loop repeats while the guess is not the secret.
Too high.Too low.Correct in 3 tries.Type the three guesses in the Input box, one on each line.
Log in to join the discussion.
Loading…