#!/usr/bin/ruby

#
## https://rosettacode.org/wiki/Guess_the_number
#

var n = irand(1, 10)
var msg = 'Guess the number: '

while (n != read(msg, Number)) {
    msg = 'Wrong! Guess again: '
}

say 'Well guessed!'
