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

Whoop :) How did you do it using Math::Combinatorics?

  • Comment on Re^3: Wordfeud racks (Math::Combinatorics)

Replies are listed 'Best First'.
Re^4: Wordfeud racks (Math::Combinatorics)
by Anonymous Monk on Jul 30, 2013 at 13:24 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)