Jun-23-2018, 07:29 AM
You want to indent the last two lines of code once. Then they will be part of the outer while loop, the one that tests choice.
But are you sure this is the code you are running? It doesn't produce the behavior you mention. It goes into an infinite loop because choice never changes in the loop. It never asks if you want to play again.
Note that if the player does want to play again, you need to reset num to a new random value. Otherwise the old guess will still equal the old num, and the inner while loop will never activate.
But are you sure this is the code you are running? It doesn't produce the behavior you mention. It goes into an infinite loop because choice never changes in the loop. It never asks if you want to play again.
Note that if the player does want to play again, you need to reset num to a new random value. Otherwise the old guess will still equal the old num, and the inner while loop will never activate.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures