Course:CPSC312-2023/Boggle

From UBC Wiki

Authors: Melika Soltaniseresht, Hasan Siddiqui, Andrew Cheah

What is the problem?

We created a solver for the word game Boggle using Prolog, and an GUI that present the results. The solver supports displaying 3 by 3 and 4 by 4 boggle boards solutions, as for longer lengths the computation time become extremely large (discussed later).

What is the something extra?

To make our project special, we implemented a variety of features. We implemented the ability to generate randomly populated grids of any size (through query). As well, made use of Princeton's WordNet database in order to retrieve definitions and check the validity of found phrases. And finally, we used XPCE to visually display the results of our randomly generated solver.

What did we learn from doing this?

(This should be written after you have done the work.) What is the bottom-line? Is functional programming suitable for (part-of) the task? Make sure you include the evidence for your claims.

We learned that Prolog is extremely powerful for these kind of evaluation tactics, it was extremely easy to model our abstraction in Prolog terms, and made getting started easy. However, we found it difficult to work with "arbitrary sized" GUI as prolog's XPCE library requires certain characteristics which made modelling our arbitrary situation difficult i.e. UUIDs. We found that once we had limited our scope from arbitrary boggle boards lengths for performances sake, it became significantly easier to as well model our abstraction. For example, calculating adjacent indexes was made immensely easier with a limited context. Overall, we found that functional programming was extremely suited for the computational task of solving a boggle board, while 4 by 4 matrices still take over 10 minutes to solve, considering a 4 by 4 contains 12 million paths (reference @ 1) , and thus 12 million possible words, we found that 10 minutes was impressive. However, for the tasking of presenting the results to the user, we found Prolog's main GUI library rather lacking and found it difficult to provide any kind of substantial UI, problems like the need to generate unique IDs manually for objects made displaying arbitrary-ly sized boards, unamenable.

Links to code etc.

https://github.com/atcheah/boggle-solver

1.https://cs.stanford.edu/~zelenski/boggle/#:~:text=Board%2Ddriven%20search.&text=There%20about%2012%20million%20distinct,consuming%20to%20check%20them%20all.