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

Re: Combinations with variable length

by davido (Cardinal)
on May 10, 2021 at 22:07 UTC ( #11132356=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Algorithm::Combinatorics qw(variations_with_repetition);
    
    ...
    while (my $variant = $variations_iterator->next) {
        print "@$variant\n";
    }
    
  2. or download this
    1 1 1
    1 1 2
    ...
    2 1 2
    2 2 1
    2 2 2
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2021-07-31 18:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?