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

Re: (Golf as well): List of Partitions

by Masem (Monsignor)
on May 06, 2001 at 16:54 UTC ( #78346=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub P {
    $_[0]?map{my$c=$_;map[$c,@$_],P($_[0]-$c)}(1..$_[0]):[]
    }
    
  2. or download this
    sub P {
    my$b=$_[1]||$_[0];
    $_[0]?map{my$c=$_;map[$c,@$_],P($_[0]-$c,$c)}grep{$_<=$b}(1..$_[0]):[]
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://78346]
help
Chatterbox?
Tux is digging into a File::Temp blocker bug for perl5 (AIX and HP-UX and most likely also other OS's)

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2018-04-26 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?