[plug] scrabble regex

John Clayton mageaere at hotmail.com
Fri Jun 20 18:34:20 WST 2003


begin;
String charList;
File mainWordList;
File searchWordList = filter out words in mainWordList that have characters 
not in charList;
searchWordList = filter out words in searchWordList that have more 
characters than the number of characters in charList;
File compareWordList = searchWordList;
for each character in charList
{
     for each word in compareWordList
    {
        remove first instance of character from word;
    }
}
for each word in searchWordList
{
    if coresponding word in compareWordList has a length greater than 0
    {
        delete word from searchWordList;
    }
}
end;

searchWordList now contains the words you are looking for.

This can be easily implemented in perl.

>Hi all,
>
>I am trying to write a program tht will assist with games such as scrabble,
>bogle, and various other word-games.  I have a dictionary of several tens 
>of
>thousands of words that I got from the linux ispell dictionary and I was
>using a regular expression to match the words that can be made from the
>letters I have available.

_________________________________________________________________
Get mobile Hotmail. Go to  http://ninemsn.com.au/mobilecentral/signup.asp



More information about the plug mailing list