While( user == gullible ) [...] PLEASE HELP MY BRAIN IS GOING TO EXPLODE! |
What an inspired name! Isn’t it? :-)
Everyone who’s giving you a help today got through the same sensation more then once in the past, me the first.
Short answer:
coder777 has already given you the right solution.
Long answer:
Thomas1965 gave you the decisive hint:
Thomas1965 wrote: |
---|
The game is over if x == 5 or chance > 10 |
That means:
- your loop will stop running if user’s answer is 5 *or* the attempt number is more then 10.
Actually what you need is the condition to *keep* the loop running, which of course is the opposite of the above:
- if you want your loop to run, *both* the user’s answer must be not 5 *and* the attempt number must be below 10.
After you’ll have solved your “while” issue, you could try to guess what coder777 was also emphasising:
if you start counting from 0 and you get to 10, how many attempts would you count?
;-)