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

Re^3: Scrabble word arrangements with blank tiles

by Anonymous Monk
on Nov 14, 2005 at 09:13 UTC ( [id://508245]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use Algorithm::Loops qw( NextPermute );
    
  2. or download this
    my @list= sort ('A'..'B'); # Find unique permutations for AB?
    my $cnt;
    my @list1;
    
  3. or download this
    # $l represents one blank tile cycling thru all letter values
    for my $l ('A'..'Z') {
    
  4. or download this
      @list1 = sort(@list,$l); # Very important to sort
      print"@list1\n"; # Show what's happening
    
  5. or download this
      printf"%5d. ", ++$cnt;
      print"@list1\n"; # Display permutations
    
      } while( NextPermute( @list1 ) );
    
    }
    
  6. or download this
    print"Counted $cnt unique permutations";
    print $/;
    
  7. or download this
    A A B
     1. A A B
     2. A B A
    ...
    ...
    ...
    Counted 150 unique permutations
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-20 02:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found