in reply to Wordfeud racks

Algorithm::Permute?
  • Comment on Re: Wordfeud racks (Algorithm::Permute)

Replies are listed 'Best First'.
Re^2: Wordfeud racks (Algorithm::Permute)
by Anonymous Monk on Jul 30, 2013 at 12:35 UTC
    No, that is about permutations, where order matters. What I want is all unique combinations...
    /L
        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