i am trying to make a program that will create a secret number, once it has been randomly selected the program runs a loop until guessing random numbers until it finds the secret number. but, my program simply creates a random number to try to guess the secret number only once and continually loops that one number down the screen. im not sure what is wrong, but if someone knows, please help.
Joined: Sep 16, 2009
i looked through the apis and found a better way to create my random number, but it still doesnt work properly.
There's no statement that would create a new random number in the loop, that's why it loops endlessly.
I'm not sure why you're checking for "<"; from your description it sounds as if you should be checking for "!=" - in which case the the second while statement is superfluous, because both numbers are guaranteed to be equal at that point.