5.0

5.0 | 1 rating Rate this file 2 Downloads (last 30 days) File Size: 397.23 KB File ID: #28050

iPod Scramble Solution

by Raj Sodhi

 

29 Jun 2010

Solves the Scramble game (like Boggle) by Zynga on my iPod.

| Watch this File

File Information
Description

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.

MATLAB release MATLAB 7.6 (R2008a)
Other requirements I ran this code OK on my Windows XP platform.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
14 Feb 2011 Emanuele Natale

fantastic

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
ind2sub Raj Sodhi 29 Jun 2010 10:22:31
sub2ind Raj Sodhi 29 Jun 2010 10:22:31
boggle Raj Sodhi 29 Jun 2010 10:22:31
scramble Raj Sodhi 29 Jun 2010 10:22:31
zynga Raj Sodhi 29 Jun 2010 10:22:31

Contact us at files@mathworks.com