Archived

This topic is now archived and is closed to further replies.

Making a Boggle Clone?

This topic is 5978 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi! yesterday, for no apparent reason, i remembered a project i started (and abandoned) a long time ago: a boggle clone. The main problem I had with the game was this: how do can you make each board totally random, yet be able to check for words. I know how to make the board random, and how to see if that word actually is there, but how would you check to see if the player entered a real word? so that brings me to my question: is there any function inside a library/header file/code/etc... that could allow me to use the word entered in as a parameter, and returns wether the word exists? thanx, ~~KaMiKaZ~~

Share this post


Link to post
Share on other sites
I don''t know for windows, but on most linux systems, you find the ispell library. Its actual use is spellchecking, but you can also make use of it in your game, since it has dictionaries in several languages so maybe you can use one of those. If you don''t mind using GPL that is.

Share this post


Link to post
Share on other sites
Its basically just a dictionary lookup. You need to get a list of ''real words'' and then write a function which just, given a word, searches the word list for a match to see if the word is ''real''. There''s no magical algorithm for determining whether or not a word is valid.

Search on the web for "english word list" and you should find several sources of large word lists to use for your matching function.

Some things to consider: You probably want to add some algorithmic support for things like plurals. Like if the word is in the list, but missing an s at the end, its OK because its a plural (this would allow some degree of cheating as users could pluralize words that can''t normally be pluralized. If that really bothers you, you could store meta information along with the wordlist which marks things like what part of speech the word is, whether it should allow plurals of the word, etc, but that''s a much larger data management issue than a simple word list and probably not really needed).

Its also a good idea to let users add their own words to a seperate user created word list that''s also matched against. Again this might be used to ''cheat'' but if the user wants to ruin the game for him/herself, that''s their problem. But if there''s a word they commonly use that isnt in your approved word list its sure to tick them off.

Share this post


Link to post
Share on other sites