Boggle Board Solver

Project description

This program was written for an assignment in my Data Structures and Algorithms class. As part of the assignment, I wrote the methods for two classes - Boggle and Dictionary. The boggle class took a dictionary file and a boggle board as input and solved the board by finding all possible words based on the given dictionary. The solve could be saved onto a file for later viewing. It utilized recursion to solve the board.

The Dictionary class served two main purposes: it allowed dictionaries to be loaded, saved, edited, and copied; it also assisted in solving the board by providing checks on the words and keeping track of the amount of words. This class is a Tree type class, so all operations on it were written for a tree.

I utilized several computational techniques and algorithms while completing this project. Two dimensional arrays were used to represent the board. The board solver utilized recursion to implement a depth-first search (DFS). In-order traversal was used for printing tree contents, pre-order was used for making deep copies, and post-order was used for deleting, all of which also utilized recursive formulas.

This was part of an individual assignment for my Data Structures and Algorithms class. I was provided with the skeleton of each class (names of methods and attributes).

Top 5 Skills Demonstrated

Click to download the zip file for this project:

boggle.zip

Demo:

Raw word output
Word Output

The program ran in the console and first asked the user if they wanted to see the Boggle board as a reference when presenting the found words. Here is the result if you choose not to see the board.

Board output
Showboard 1 Showboard 2

If you choose to see the solved board for every word, this is the result.

Board Output Explanation
Showboard Explain

For each output entry, the first line is the word found on the board, the socond line shows the number of words found up to that point, and the following output is the board itself with the used letters quoted. Next to it is a numeric board showing the order in which the letters were visited.

Output File
Output File

When the program executes, it also saves the output to an external file. The type of output saved depends on the user's choice.