xr82
June 9th, 2009, 02:47 AM
Hi all,
So I was at a party the other night and we were playing boggle and I got this seed of an idea that it would be cool to "crack" boggle.
So I started writing the program and so far I've got it to output all the possible word combinations (including those which aren't necessarily words, e.g akvckzis).
Now I want to use those results to see if I can find a match in /usr/share/dict/words.
The method I am currently using is slow! Every time I get a new word combination I open the dictionary and search through the whole thing, report if their was a match and then close the dictionary.
Repeat ad nauseum. Who has a better idea on how I can speed this up?
(Maybe I could load the file into memory... still the linear fashion in which I'm searching is the real bottle neck).
So I was at a party the other night and we were playing boggle and I got this seed of an idea that it would be cool to "crack" boggle.
So I started writing the program and so far I've got it to output all the possible word combinations (including those which aren't necessarily words, e.g akvckzis).
Now I want to use those results to see if I can find a match in /usr/share/dict/words.
The method I am currently using is slow! Every time I get a new word combination I open the dictionary and search through the whole thing, report if their was a match and then close the dictionary.
Repeat ad nauseum. Who has a better idea on how I can speed this up?
(Maybe I could load the file into memory... still the linear fashion in which I'm searching is the real bottle neck).