Ruby version of Guess program I wrote in Perl