Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Generator of integer partitionts of n

by kvale (Monsignor)
on Aug 28, 2004 at 02:35 UTC ( #386540=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $integer = 5;
    my @p;
    ...
          part( $n-$k, $j, $t+1);
       }
    }
    
  2. or download this
    1004% perl part.pl
    5
    ...
    2 2 1
    2 1 1 1
    1 1 1 1 1
    
  3. or download this
    my $integer = 5;
    my @p;
    ...
          part( $n-$k, $j, $t+1);
       }
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://386540]
help
Chatterbox?
[Eily]: oh, boolean context uses the "" overload if no bool overload has been defined
[Eily]: (I wondered if overloading bool was actually necessary)
[Corion]: Yeah, you need bool to get a true value, and the rest to return the other value ;)
[choroba]: perl -wE '{package o; use Tie::Scalar; use parent -norequire => "Tie::StdScalar" ;sub FETCH { "x" x int rand 2}} tie my $x, "o" ; say $x for 1 .. 10'
[choroba]: for complete ness

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2017-07-27 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (414 votes). Check out past polls.