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