BoggleTM - source code

This is a resource of the mailing list.

Click to subscribe to wordgame-programmers

Here is a wide selection of algorithms for finding the words in a boggle layout. Generally these are a depth-first search, hopefully with pruning on the fly. Some of these are very fast and others are very slow.

We also have some code for generating Boggle layouts - doing it randomly is trivial, but generating a layout in order to maximise the number of words found, or to fit specific words into the board, is far from trivial. We have code examples here which generate dense Boggle boards using techniques such as genetic algorithms and simulated annealing. This is not a problem that can be solved by brute force. (An ongoing conversation on this theme can be found at StackExchange)

Note these other games above (Traverse and Word factory) which are scored in a manner similar to Boggle, for which the software below would be just as relevant.

Visit the Official Hasbro Boggle Site

There are many web sites on the net which allow you to play Boggle interactively. If that's what you're looking for, go use Alta Vista or any of the search engines to find them on your own. Some sites offer a game called "Tangleword" which seems to me almost identical to Boggle. There are no downloadable executables here and no interactive web games. What we have on our archive are only the sources of computer programs for academic study. Read the rules to Boggle if you're not familiar with the game.

These are the programs which create densely-populated Boggle layouts
These programs solve boggle puzzles or play boggle interactively.
Finally, here are pointers to other boggle implementations for which we have not yet located source code:
Writing a boggle playing program is too easy, as you can see from the above. And it will always win. What we need is a way to make a boggle playing program interesting. Yes - it is possible to 'dumb down' a program by merely not claiming all the words it can find; it's even possible to do it fairly convincingly by restricting the program to a limited vocabulary more in line with that of your average human; but those are cheap shots. What would be a challenge is to make a boggle program behave like a real human, and do its best. Here's one approach I might be tempted to try: The boggle program does *not* have access to a word list. It can be trained on various word lists (like a human learning a language) but is has limited memory. It might explicitly store some frequently used common words, but the less common words can't be stored explicitly. Something like a hash table might be allowed, as long as it has less than perfect accuracy. A digraph and trigraph table might be OK, but not an exhaustive one. The program might even be allowed to look up some possible words once it has hypothesized them - but it might be limited to no more than X/2 lookups, where X is the average number of words that its opponent usually finds. This way the program is really trying its best under adverse conditions, in a way the human can relate to - and have a chance of beating. It's also important that the computer makes a few mistake - words it thinks may be plausible but which aren't in the dictionary. A neural-net version of Boggle would be fantastic! The human player will enjoy such a game much more than one in which the computer obviously knows all the answers but has decided just to throw the game to give the poor human a chance...
See also ScrabbleTM. Or return to the Archive overview.
Boggle is a trademark of Hasbro Inc. (formerly Parker Brothers).
Scrabble is a trademark of Hasbro Inc in the US (formerly Selchow and Righter) and Mattel (formerly J.W. Spears) elsewhere.