BoggleTM - source code
This is a resource of the
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
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.
- Neil Pearce's Boggle
I haven't tried the executable, but the source looks well written
and shows how to write a Windows GUI program, as well as handling
the basic word-finding engine.
You can't say we're "C" bigots here - we've got every language
you could think of. And here's one you'ld never think of - a version
of Boggle written in Euphoria.
Here's one I wholeheartedly approve of. Not only does this one
"get it right" (i.e. use the same algorithm as my own code ;-) ),
it improves it by passing the trie walk along with the board walk, thus
avoiding the unneccesary overhead of re-checking prefixes on each move, while
pruning. Basically what I'd have written myself if I hadn't been in
such a hurry to get something out. 10/10. Written by Jeremy Elson (firstname.lastname@example.org)
A replacement for the original Unix boggle which was proprietary
to Sun. Uses an adjaceny matrix rather than a general DFS. The dictionary
lookups are less than optimised. Display is cursor-addressed terminal,
so should be portable to almost any environment. Originally
from a Usenet post.
Two for the price of one here. We have the C++ class's version (CPS108),
and the Java class's version - the latter with both the staff version and
one student's project. Note although there is a file in here called "Joggle"
it is not the same as Robert Diamond's game which was withdrawn
due to threats from Hasbro's lawyers.
- Guy McArthur's Joggle
A third program called 'Joggle'... this one is GPL'd. Here's the
My own effort. Short & simple; uses the DAWG data structure that
almost all of my word games and utilities share. If you can't work out
the recursive algorithm from this code, you're either not a C programmer
or you shouldn't be. I recently made a quick hack to this to make it sort-of
command line compatible with the old Unix boggle for use in Phil Goetz's
genetic algorithm above. Also, chagrined at being out-programmed
by Jeremy Elson ;-) I recently modified my code to do the more efficient
parallel trie-walk that his does.
Interestingly, this Boggle for the Mac is written in BASIC.
Client/Server networked Boggle in Java.
Multi-user Boggle project in C. I have to say, creaking ancient programmer
that I am, I find this stuff a lot more easy to follow than the multi-user
Java versions above.
Boggle in Java for the Palm Pilot. And I didn't even know the Palm Pilot
Boggle for OS/2 from David Boudah, with full IBM Classes code for the user interface. Main
solving engine is in board.cpp. His explanation
of the adjacency matrix is a bit more clear than that of the bsd version above.
Russ Hall's Boggle in BASIC.
Adrien Treuille's Tangleword (Boggle clone) solver. See the
web page to use it.
- COMS40203/ (Bristol University exercise)
One of the student's solutions also includes
a good user's guide.
A sample solution is in boggle_mcternan/
One student's decompiled sources are here.
X windows game in wish (tcl/tk)
Boggle in Perl/TK by email@example.com
- Perl Boggle
Another Perl boggle by Ronald J Kimball firstname.lastname@example.org
I'm not sure, I think this may be an APL-related language which is embedded
in some sort of X-windows display system.
- Boggle in Lisp by Jason S Cornez
See the attached Usenet discussion...
- Johntology Boggle
- Mark Congdon's Wordcube Challenge and Solver
- Kent Smotherman's Java Boggle for the Palm Pilot
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
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.