Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Another word puzzle with too many permutations

by oiskuu (Friar)
on Oct 16, 2013 at 16:24 UTC ( #1058492=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Another word puzzle with too many permutations
in thread Another word puzzle with too many permutations

I noticed it too, that you score caps only. That said, if you score by length, it works nicely as well.
Another smart thing is to remove impossible words at earliest opportunity.

DOG: for my $dog (@_) { my $remaining = $letters; $remaining =~ s/$_//i or next DOG for split //, $dog; push @remain, $remaining; push @dogs, $dog; } while( my $dog = shift @dogs ) { dogtree( "$tree $dog", shift @remain, @dogs ); }
The given puzzle solves in 1-2 secs, and takes about 3 minutes for a full pass (return instead of exit).
Only one solution exists. A letter set such as
"A(11),B(3),C(2),D(8),E(6),F(1),H(8),I(10),J(1),K(1),L(6),M(1),N(10),O(9),P(2),R(7),S(6),T(9),U(7),V(1),W(1),X(1),Z(2)";
takes some 20 times longer...


Comment on Re^4: Another word puzzle with too many permutations
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2015-08-30 18:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (350 votes), past polls