Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # random game
- x = rand(100)
- guess = -1
- while guess != x
- puts('Please enter a number between 0 and 99')
- guess = gets.to_i
- puts(guess.to_s + ' is too high!') if guess > x
- puts(guess.to_s + ' is too low!') if guess < x
- end
- puts(x.to_s + ' is the right number!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement