Miguel Regedor wrote:
> I like the diff hash :p clever!

diff = {
  -1 => proc { puts "The number is larger" },
  0  => proc { throw(:done) },
  1  => proc { puts "The number is smaller" },
}

catch(:done) { loop { diff[gets.to_i <=> number][] } }
-- 
Posted via http://www.ruby-forum.com/.