- Fill a 255 sized array with zeroes
- Loop through the given letters, converting them to ascii and then incrementing that location in the array
- Get a word from the dictionary file
- Do steps 1 and 2 again with the word from the dictionary file.
- If any of the locations in the second array are bigger than the 1st, the word is not an anagram
- Else, add the word a list
- Go back to step 3 untill you are out of words in the dictionary file.
Edit:
Heres a proof of concept for that algorithm. I also made a little bot to type it for you. I'd suggest having a copy of notepad running when you use this.
source code and dictionary file included.
http://www.megaupload.com/?d=A1XVC576
No comments:
Post a Comment