From: Siep Korteling Date: 2010-03-09T19:17:16+09:00 Subject: Re: Shortest code Prasanth Ravi wrote: > Aaron D. Gifford wrote: >> Ruby 1.9: 34 characters >> >> eval(gets.scan(/(?:^| )(\d+)/)*?+) >> >> Aaron out > > tx aaron this is by far the shortest code ive seen... A variation: p eval gets.split(/ |-\d+/)*?+ Siep -- Posted via http://www.ruby-forum.com/.