in reply to Re: Wordfeud racks (Algorithm::Permute)
in thread Wordfeud racks

No, that is about permutations, where order matters. What I want is all unique combinations...
/L
  • Comment on Re^2: Wordfeud racks (Algorithm::Permute)

Replies are listed 'Best First'.
Re^3: Wordfeud racks (Math::Combinatorics)
by Anonymous Monk on Jul 30, 2013 at 12:59 UTC
      You can try the following representing a bag with tiles AAABBC and asking for racks of 2 tiles
      use Math::Combinatorics qw(combine); my @data = qw(A B C); my @frequency = qw(3 2 1); my $racklength = 2; my $combinat = Math::Combinatorics->new(count => $racklength, data => [@data], frequency => [@frequency], ); while(my @combo = $combinat->next_multiset){ print join(' ', @combo)."\n"; }
      Replace sample values with actual values for Wordfeud to watch the results print at a very slowly pace down your screen. /L
        ok, I see what's what now after I look inside , its much like choroba wrote , %seen

        so Algorithm::Combinatorics doesn't appear to support that(%seen) out of the box (I see no cache, no hv)