Skip to content

Instantly share code, notes, and snippets.

@b-adams
Created September 23, 2011 02:53
Show Gist options
  • Save b-adams/1236644 to your computer and use it in GitHub Desktop.
Save b-adams/1236644 to your computer and use it in GitHub Desktop.
bool hasNotGuessedCorrectly;
hasNotGuessedCorrectly = true;
while(hasNotGuessedCorrectly)
{
if(yourGuess < myNumber)
{
printf("Too low.\n");
}
else
{
printf("Too high.\n");
}
yourGuess = getNumberFromUser();
hasNotGuessedCorrectly = (yourGuess != myNumber);
}
printf("Yay\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment