Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: integer partition golf

by shmem (Chancellor)
on Oct 19, 2006 at 13:47 UTC ( [id://579362]=note: print w/replies, xml ) Need Help??


in reply to Re: integer partition golf
in thread integer partition golf

I don't think it can go much lower. I can only see a 1-character savings at this point, for 79:
sub p{my(@e,$o)=@_;$_{$_=join$",sort@_,$/}||=print;p(++$o,@e)while--$e +[0]}p pop

I second that.

I don't think it can go much lower. I can only see a 1-character saving at this point, for 78:

sub p{my(@e,$o)=@_;$_{$_="@{[sort@_]}\n"}||=print;p(++$o,@e)while--$e[ +0]}p pop

:-)

That fixes the leading $/, too.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^3: integer partition golf
by cephas (Pilgrim) on Oct 19, 2006 at 14:03 UTC
    Chopped on more char.....
    sub p{my(@e,$o)=@_;${$_="@{[sort@_]}\n"}||=print;p(++$o,@e)while--$e[0]}p pop

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://579362]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-24 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found