My family enjoys playing games and one of our favorites is Boggle, an addictive word game where players attempt to find as many words in a 4x4 grid of
letters. At the end of a game, players are left wondering whether there were any unearthed words. To answer this question once and for all, I created an
online Boggle solver using ASP.NET version 3.5.
This article is the second installment in a two-part series. Last week's article, Building
the User Interface, examined the Boggle solver web page's user interface, which consists of 16 TextBox Web controls arranged in a 4x4 grid and three
Button Web controls for solving the user-entered puzzle, solving a randomly-generated puzzle, and clearing the board. A ListView control is used to display
the solutions in a three-column HTML <table>. The user interface also included a handful of JavaScript functions to ease entering the
board data.
This second and final installment details the code used to solve the puzzle. Solving the puzzle requires having a dictionary of legal words and objects
that mirror the structure and functionality of the board and of solutions. These objects are implemented as classes that include internal data structures
that use a number of features in the .NET Framework, including: Generics; automatic properties; and caching. The complete source code is available for
download at the end of the article.
Try out the live demo or read on to learn more!
Read More >