On Wed, Mar 10, 2010 at 9:07 AM, Prasanth Ravi <dare.take / gmail.com> wrote:
> Florian A=DFmann wrote:
>> interesting...
>>
>> ree-1.8.7-2010.01 > puts eval(gets.gsub(/(?:-\d|[^0-9])+/, '+')<<'+0')
>> 1 2 3 -4
>> 6
>> =A0=3D> nil
>> ree-1.8.7-2010.01 > puts eval(gets.gsub(/(?:-\d|[^0-9])+/, '+')<<'+0')
>> 1 -2 3 4
>> 8
>> =A0=3D> nil
>>
>> ol' ruby?
>>
>> Am 09.03.2010 um 04:39 schrieb Prasanth Ravi:
>
> irb(main):010:0> puts eval(gets.gsub(/(?:-\d|[^0-9])+/, '+')<<'+0')
> 3 4 -5
> 7
> =3D> nil
> irb(main):011:0> puts eval(gets.gsub(/(?:-\d|[^0-9])+/, '+')<<'+0')
> -56
> 6
> =3D> nil
>
> was it -(56) or -5 & 6 ? :D
> --
> Posted via http://www.ruby-forum.com/.
>
>
1 -2 8 is nice too ;)
Even spec your golfs !!!


--=20
Learning without thought is labor lost; thought without learning is perilou=
s.=94
--- Confucius