Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm building a game where I form words (think Scrabble) and I need to have them validated in real-time, meaning that I need to have some sort of word list loaded where I can check if the word made exists or not.

I was wondering what would be the best way to store that list, should I just create an Array or use some sort of database (sqlite3 in this case).


share|improve this question

One of the most space-efficient ways to store dictionary words for quick lookup is a trie.

share|improve this answer
I used a trie for a game I wrote in Actionscript 3 with good results. My dictionary had about 80,000 words and I scanned the board for all possible words in real time. The advantage of a trie over a dictionary is better space efficiency and the ability to find all prefixed words in a string. i.e. the string "catchers" contains the words "cat", "catcher", and "catchers". – Alex Schearer Sep 28 '10 at 18:19
Thanks, I will take a look at trie. Never heard of them to be honest. – IvanSF Sep 29 '10 at 19:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.