Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var random = Math.floor((Math.random() * 5) + 1);
- var guess = 0;
- var name = prompt("What's your name?")
- while(random != guess) {
- var guess = prompt("Guess the number (1-5).")
- if (random == guess) {
- alert("Congrats! You picked the number")
- } else {
- alert("Whoops! Wrong number. Try again.")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement