Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: compute paths in Pascal's triangle (aka Tartaglia's one)

by oiskuu (Hermit)
on Mar 22, 2018 at 20:23 UTC ( [id://1211566]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #! /usr/bin/perl
    
    ...
    while (my $x = $it->()) {
        dd $x;
    }
    
  2. or download this
    sub choose {
        my ($n, $k) = @_;
        !$n ? (["$n-$k"]) x !$k
            : map [@$_, "$n-$k"], choose($n-1, $k), choose($n-1, $k-1)
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-24 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found