Ruby 2.0

trans. (T. Onoma) ha scritto:

Amazing. Is any one making a collection of these?

T.

well, there is:

I guess we would need to add a link in that page to someone like
TheGreatShortOneLinersAndDucksConvention to collect all the stuff of this days :slight_smile:

Mauricio Fernández wrote:

It can be made to fit in a canonical 80-char line (actually 78):

a=;10.times{|n|a<<1;puts" "*(9-n)*3+"%6d"*(n+1)%a;n.times{|i|a[n]+=a[n-=1]}}

Small one: (two more chars)

···

a=;10.times{|n|a<<1;puts" "*(9-n)*3+"%6d"*-~n%a;n.times{|i|a[n]+=a[n-=1]}}

Florian Gross wrote:

Small one: (two more chars)

a=;10.times{|n|a<<1;puts" "*(9-n)*3+"%6d"*-~n%a;n.times{|i|a[n]+=a[n-=1]}}

Another obvious one:

a=;10.times{|n|a<<1;puts" "*(9-n)*3+"%6d"*-~n%a;n.times{a[n]+=a[n-=1]}}

We're down to 73 now.

Florian Gross wrote:

>Small one: (two more chars)
>
>>a=;10.times{|n|a<<1;puts"
>>"*(9-n)*3+"%6d"*-~n%a;n.times{|i|a[n]+=a[n-=1]}}

Another obvious one:

>a=;10.times{|n|a<<1;puts" "*(9-n)*3+"%6d"*-~n%a;n.times{a[n]+=a[n-=1]}}

                                                           (|i|) DUH

···

On Thu, Dec 09, 2004 at 06:07:28AM +0900, Florian Gross wrote:

We're down to 73 now.

--
Hassle-free packages for Ruby?
RPA is available from http://www.rubyarchive.org/