Created
February 6, 2015 03:24
-
-
Save carjug/ab39bb9e94d87147c513 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var guess, answer, message; | |
answer = Math.floor(Math.random() * 10); | |
while (guess != answer) { | |
guess = prompt("How many cats does the old lady own?"); | |
if (guess == answer) { | |
message = "She has exactly " + guess + " cats!" | |
} | |
else { | |
message = "Wrong, guess again!" | |
}; | |
alert(message); | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment