From: Peter Hickman Date: 2013-06-01T05:45:33+09:00 Subject: Re: Eloquent Ruby Kaprekar's Number --001a11c1b7641b8ae504de09b258 Content-Type: text/plain; charset=ISO-8859-1 Your new version is much clearer. But I will nitpick anyway :) midpoint = (num_len / 2) left = num_square[0...midpoint].to_i right = num_square[midpoint..-1].to_i There is no need to do the -1 / +1 thing by using the ... range operator. However the fact that it is ... rather than .. is easy to overlook when reading code so I can understand peoples reluctance to use it. --001a11c1b7641b8ae504de09b258 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Your new version is much clearer. But I will nitpick anywa= y :)

=A0 midpoint =3D (num_len / 2)

<= /div>
=A0 left =3D num_square[0...midpoint].to_i
=A0 right = =3D num_square[midpoint..-1].to_i

There is no need to do the -1 / +1 thing by using= the ... range operator.

However the fact that it is ... rather than .. is easy t= o overlook when reading code so I can understand peoples reluctance to use = it.

--001a11c1b7641b8ae504de09b258--