Re: while loop not behaving properly.
What you want to do is use a while loop to keep looping until the guess is correct.
That is what you had commented out.
Then inside that while loop, use 2 if statements, to check if it is to high or to low and print out the apporiate hint.
here is some pseduocode
Code:
get guess from user
while( guess is not right answer)
{
if guess is to high
tell user guess is to high
else //there guess was not right, and not to high, it must be low
tell user guess is to low
get guess from user
}
tell user they got it :)