I was playing the game Scramble on my iPod touch, and I realized that I wasn't very good. But the algorithmic challenge of writing a program to solve the Scramble (same as Boggle) game was too tasty to pass up. It was indeed quite challenging, but quite satisfying in the end. The program first obtains a list of legal words ("I didn't know that was a word...") from a text file. Since the letter "Q" is always represented as "Qu", we change the dictionary words to delete the following "U". The user has to input the board as a 25 character array in the top-level program called "word4.m". In order to find the nearest neighbors of each of the letters and the board, I experimented with both single indexing of an array and x-y coordinate indexing of an array. The algorithm finds the nearest neighbor, and then the neighbor of the neighbor to construct character sequences. The character sequences are compared against the word list to see if they are promising, and if not, the character sequence is pruned. Finally, a final word list is generated and sorted by word length.
Raj Sodhi (2023). iPod Scramble Solution (https://www.mathworks.com/matlabcentral/fileexchange/28050-ipod-scramble-solution), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!