Number Guessing Game Part 7

Exercise: Number Guessing Game, Part 7

When the player guesses the secret number, tell the player how many guesses it took them and congratulate them using their name.


        • Remember your “number of guesses” variable? Now is time to use it! The cat should say something like this “It took you ____ guesses to win!”
        • Remember you asked the player for their name in the beginning of the game? Now it is time to use it! You should have made a variable called “name” a few steps ago, but if you didn’t go back and add this variable now. What should you set “name” to?
        • How do you join the word “CONGRATULATIONS” to the player name?

Guesses to Win Stage