num = ceil(rnd*10) while true x = val(input("Your guess?")) if x == num then print "Well guessed!" break end if end while