Page 65 -
P. 65
change the game
Now, it’s time to apply your programming mojo. Be warned: this exercise is kind of tricky.
You need to rewrite your game program so it keeps running until the user guesses the
correct answer. You will need to use all of the things you’ve learned in this chapter. You will
need to work out the conditions for each of the branches and loops that are required.
Remember: the program needs to keep asking the user for an answer while the current
guess is wrong.
Hint: If you need to test that two things have different values, use the != operator.
This is the “not
equal to" operator.
Write your
code here.
30 Chapter 1