Sign in to follow this  
Andrew Kabakwu

Word Games Question

Recommended Posts

Andrew Kabakwu    941
Hello,
I was wondering if word games could be made without having to load a words dictionary to check created words against.

Is it possible?

If not, what are the options for getting a word dictionary into a loadable file?

Thanks

Share this post


Link to post
Share on other sites
Telgin    200
In the end, you're going to have to ask a data source [i]somewhere[/i] if a word is valid. There are a number of ways you could do this though that would avoid requiring the entire data set to be in a loadable file.

You didn't specify what language and environment you're planning on working in. Is this an online game of some sort? Flash? Browser? Mobile Phone?

If your program does have access to the internet, then you could always send the words off to a remote server to verify if they're valid. You could set up a web server using whatever server side language you want, set up a database in the DBMS of your choice and load a set of words up in that. You could then use the web server to validate words by a number of means (xmlHttpRequest, JSON, heck even raw sockets if you really wanted to).

The advantage of doing this is that you have up to date word lists in a single place that all copies of your game will work from. You wouldn't have to send (a potentially very large) word file with the installation of your game, and wouldn't have to send updates to your clients.

The disadvantage of doing this is that you now require internet access for your game, and will have to set up a web server somewhere and pay for its bandwidth usage (probably not a big deal these days really).

If you do want to keep the word file locally, you could still use a simple database I suppose. It's been a long time, but I believe SQLite or similar technology would be fairly easy to build into the game. This wouldn't really have a whole lot of benefits though, and would add a lot of complication to the program. For simple games at least, you would probably be better served by just loading a word file.

As for procuring a dictionary to use... sorry, can't help you there. I imagine there is probably a database dump somewhere that has a reasonably complete set of English words. Now, how large that is I can only guess.

Share this post


Link to post
Share on other sites
Adam_42    3629
Dictionaries are [url="https://wiki.mozilla.org/L10n:Dictionaries"]easy enough to find[/url] in a search engine, but be careful of licensing: http://stackoverflow.com/questions/2277703/license-of-popular-dictionary-word-lists-e-g-sowpods-twl-copyright-trademar

Memory usage shouldn't be more than a few megabytes for a big dictionary stored as plain text, and it should compress to under 1MB in a zip file. If you're really short on memory it should be quick enough for single word lookups to binary search the file on disc.

If this is a PC game it's probably worth allowing users to supply their own dictionary as a text file. This would for example let them play in another language.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this