There are several other word games out there that have
word list in the order of 40,000 words.  How in the
world do they do this?  Obviously, they must use some
sort of compression (which I am also doing), but when
I decompress my list to memory, the heap limit is 64k
which limits my word list considerably.  Sure, I could
create 20 heaps (64k each), but is this the most
efficient way to store and extract a word list?  If
so, I'd require about 640kb of free memory for my
program to run.  Surely, there must be a better way.
Don't decompress a word until its needed.

Here's an idea for a scheme: if you are storing a list of words, set up the word list as a dynamic tree... for example, if I wanted to store

do dog done donut egg

I could store it as a tree of

d -> o -> <STOP>
-> g -> <STOP>
-> n -> e -> <STOP>
-> n -> u -> t -> <STOP>
e -> g -> g -> <STOP>

It could be possible to make an efficient binary version of this, since your character set is only 26 letters long.

Perhaps you could store this using prefixes, so you could store things like this

0do
2g
2ne
3ut
0egg

Be very creative, run some tests, and you'll probably find a good scheme.

--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com

--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/


Reply via email to