Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Binomial Golf

by tachyon (Chancellor)
on May 31, 2001 at 06:00 UTC ( #84433=note: print w/ replies, xml ) Need Help??


in reply to Binomial Golf

Damn, drat, blast, gadzooks, foiled again. MeowChow not only comes up with a similar method but beats me by 4 charachters to boot!!! Using the true return from print to add a '1' to the array is really clever coding MC.

tachyon

&b(10); &binomial(10); # my simple sub sub binomial { for(0..pop){ my $last = 0; for (@_){ my $temp = $_; $_ += $last; $last = $temp; } push@_,1; print"@_\n"; } } # my golf progression sub b { #map{my$l;map{$t=$_;$_+=$l;$l=$t}@_;push@_,1;print"@_\n"}0..pop; #map{my$l;map{($l,$_)=($_,$_+$l)}@_;push@_,1;print"@_\n"}0..pop; #map{print"1 @_\n";push@_,map{$_+pop}@_,1}0..pop map{print"1 @_\n";@_=map{$_+pop}@_,1}0..pop } $\=$"; sub AUTOLOAD{@_ =caller();print shift} { package Back; ::()} { package To; &::() } { package The; &::() } { package Drawing;&::} { package Board; ::()}


Comment on Re: Binomial Golf
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2015-07-06 01:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls