From: brabuhr@... Date: 2010-09-03T00:25:07+09:00 Subject: Re: New to ruby - Need help with simple guessing program 2010/9/2 Jesús Gabriel y Galán : > Apart from other suggestions, here some are some notes: > On Thu, Sep 2, 2010 at 3:28 PM, Evan Riley wrote: >> Here is my current code: >> >> random_number = rand(10) >> >> puts 'Can you guess the number?' >> puts 'Select a number from 1-10 please' >> >> players_number = gets.chomp > > As you are always using players_number as an integer to, I suggest > doing the to_i after the gets, so you don't have to repeat it over and > over: > > players_number = gets.chomp.to_i Or, simply: players_number = gets.to_i