```Apart from other suggestions, here some are some notes:

On Thu, Sep 2, 2010 at 3:28 PM, Evan Riley <rileyc.evan / gmail.com> wrote:

> Here is my current code:
>
> random_number =3D rand(10)
>
> puts 'Can you guess the number?'
> puts 'Select a number from 1-10 please'
>
> players_number =3D 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 =3D gets.chomp.to_i

>
> while players_number.to_i !=3D random_number.to_i

>
> =A0while players_number.to_i < random_number.to_i

As has been said, this loop is not needed, just the if

> =A0if players_number.to_i < random_number.to_i
> =A0 =A0puts 'Sorry your to low'
> =A0 =A0puts '_________________'
> =A0 =A0random_number =3D rand(10)
>
> =A0 =A0puts 'Can you guess the number?'
> =A0 =A0puts 'Select a number from 1-10 please'
>

And this should be moved to a common place once.

> =A0 =A0players_number =3D gets.chomp
> =A0end
> =A0end
>
> =A0while players_number.to_i > random_number.to_i
> =A0if players_number.to_i > random_number.to_i
> =A0 =A0puts 'Sorry your to high'
> =A0 =A0puts '__________________'
> =A0 =A0random_number =3D rand(10)
>
> =A0 =A0puts 'Can you guess the number?'
> =A0 =A0puts 'Select a number from 1-10 please'
>
> =A0 =A0players_number =3D gets.chomp
> =A0end
> =A0end
>
> =A0while players_number.to_i =3D=3D random_number.to_i
> =A0if players_number.to_i =3D=3D random_number.to_i
> =A0 =A0puts 'Congratluations! You Win!'
> =A0 =A0puts '_________________________'
> =A0 =A0random_number =3D rand(10)
>
> =A0 =A0puts 'Can you guess the number?'
> =A0 =A0puts 'Select a number from 1-10 please'
>
> =A0 =A0players_number =3D gets.chomp
> =A0else
>
> =A0end
> =A0end
> end
>
> Can anyone help me with tracking the amount of entries he makes? Thank
> you.

Regards,

Jesus.

```