in reply to Re: (Golf) Multiply polynomials
in thread (Golf) Multiply polynomials

New approach, but still 102. I don't I can break it any more...
sub p { my($a,$b)=(shift,shift); my@c=map{my($d,$e);for$e(0..$_){$d+=$$a[$e]*$$b[$_-$e]}$d}0..$#$a+$# +$b; @_?p(\@c,@_):\@c }

Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
(tye)Re: (Golf) Multiply polynomials
by tye (Sage) on May 07, 2001 at 22:09 UTC

    Simple improvement:

    my($a,$b)=(shift,shift); my$a=shift;my$b=shift; # a bit shorter my$a=pop;my$b=pop; # even shorter since multiplaction is commutative

            - tye (but my friends call me "Tye")