Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: literati cheat / finding words from scrambled letters

by GrandFather (Saint)
on Nov 20, 2005 at 23:08 UTC ( [id://510309]=note: print w/replies, xml ) Need Help??


in reply to literati cheat / finding words from scrambled letters

This may get you started:

use strict; #Load the dictionary my @words; my %dict; push @words, split ' ', lc while <DATA>; map {push @{$dict{join '', sort split '', lc}}, lc } @words; # "Generate" a letter set my $letters = join '', sort split '', $words[rand @words]; print "$letters\n"; # Find all the matching words print join ', ', @{$dict{$letters}};
<p>Adding in the wild card make this a little more interesting, but no +t much more difficult :)</p> __DATA__ want you file not my that take characters map on dictionary makes its earlier line yahoo out each cgi letter alaphbetically your but possible too with and logic combinations of time do is all followed someone to have takes from really real able create mentioned going it using concern can where pear wild dont then game more wont combination the way search a would understand faster like or in about id this for how enough anagrams by different cheat word thank be aepr best fear thousands up same are words decrease check use am verify help get should say ability familiar i letters literati as why fast

DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-03-28 21:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found