in reply to integer partition golf

Hi jimt,

        Ya know, one of these days, my golf game'll be good enough that I'll post and someone won't immediately respond and say "I can shave off another character!"

No, my hat's off to you ... and you gotta give yourself a LOT of credit.

First, you came up with the original challenge, which was fun.  And even though blazar and I stripped off 5 characters, you stripped off 5 more!

As I'm sure you're aware, that's a much bigger feat, since getting just a single character here and there gets harder and harder.

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

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^2: integer partition golf
by shmem (Chancellor) on Oct 19, 2006 at 13:47 UTC
    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}
      Chopped on more char.....
      sub p{my(@e,$o)=@_;${$_="@{[sort@_]}\n"}||=print;p(++$o,@e)while--$e[0]}p pop