S
Sandman
I just can't seem to wrap my mind around how to attack this problem in the best
way, so I thought I'd just post here and see if anyone here has done something
similar and/or has a logical solution to it.
I have a series of letters, say "kljetilamnop", then I have a big textfile with
legit words, but let's use a short one here:
mall
bill
kill
lot
pile
antilope
hello
Now, I want to cycle through this word list and match it to the letters, and
return true if the word can be formed by the letters. So, the above would
return:
mall
kill
lot
antilope
The result is to be used in a Scrabble-like fashion, which leads me to the
other part of my problem. When matching these words, I need to be able to
specify that some of the characters are "locked" in their position. So, lets
say that the letter "k" in the letter string is a fixed letter, then the only
result would be "kill" of course. I imagine that this would be easiest if I fed
the function the string and also the locked position in an array (1,6,8 for
example).
Anyway, this could easily become really complex, and if I just get the basic
scrambled-letters to match to words, I think I can manage my way from there.
So, any help appreciated.
way, so I thought I'd just post here and see if anyone here has done something
similar and/or has a logical solution to it.
I have a series of letters, say "kljetilamnop", then I have a big textfile with
legit words, but let's use a short one here:
mall
bill
kill
lot
pile
antilope
hello
Now, I want to cycle through this word list and match it to the letters, and
return true if the word can be formed by the letters. So, the above would
return:
mall
kill
lot
antilope
The result is to be used in a Scrabble-like fashion, which leads me to the
other part of my problem. When matching these words, I need to be able to
specify that some of the characters are "locked" in their position. So, lets
say that the letter "k" in the letter string is a fixed letter, then the only
result would be "kill" of course. I imagine that this would be easiest if I fed
the function the string and also the locked position in an array (1,6,8 for
example).
Anyway, this could easily become really complex, and if I just get the basic
scrambled-letters to match to words, I think I can manage my way from there.
So, any help appreciated.