Florian A??mann wrote:
> interesting...
> 
> ree-1.8.7-2010.01 > puts eval(gets.gsub(/(?:-\d|[^0-9])+/, '+')<<'+0')
> 1 2 3 -4
> 6
>  => nil
> ree-1.8.7-2010.01 > puts eval(gets.gsub(/(?:-\d|[^0-9])+/, '+')<<'+0')
> 1 -2 3 4
> 8
>  => 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
=> nil
irb(main):011:0> puts eval(gets.gsub(/(?:-\d|[^0-9])+/, '+')<<'+0')
-56
6
=> nil

was it -(56) or -5 & 6 ? :D
-- 
Posted via http://www.ruby-forum.com/.