RosettaCodeData/Task/Guess-the-number/CoffeeScript/guess-the-number-1.coffee
2013-04-11 11:14:19 -07:00

5 lines
180 B
CoffeeScript

num = Math.ceil(Math.random() * 10)
guess = prompt "Guess the number. (1-10)"
while parseInt(guess) isnt num
guess = prompt "YOU LOSE! Guess again. (1-10)"
alert "Well guessed!"