Lab 9 - Jumble App

Before you Start

ePortfolio Entries

Each entry consists of a web page and a zip file.

Programming Environment

The Lab

Acccording to Wikipedia, "Jumble is a word puzzle with a clue, a drawing illustrating the clue, and a set of words, each of which is jumbled by scrambling its letters. A solver reconstructs the words, and then arranges letters at marked positions in the words to spell the answer phrase to the clue. The clue and illustration always provide hints about the answer phrase."

Your app takes as input a jumbled word and unscrambles it. That is, it provides all words (from a given dictionary) that are an unscrambling of the given input. The view and the controller have already been implemented. Even a part of the model has already been given.

First, create your Jumble App with

The file dictionary.txt can be found here. First save the file on the desktop of your laptop. Transfer the file to the tablet using the File Manager on the tablet. Select PC file transfer (lower left corner). Open a web browser and enter the URL given on your tablet. In the web browser, within the ASUS File Manager, select Internal storage. In this folder you will find folders named Alarms, Android, etc. Do not go in any of these subfolders, but upload the dictionary.txt file in this folder.

Alternatively, you can download the file onto the tablet by visiting the course website and saving it from there. In that way, it ends up in the Downloads folder. This is a sub folder of Internal storage. Move the file from Downloads to Internal storage.

There is a third way to use the file dictionary.txt. In Android Studio, within your project, inside the res folder, create a new Android resource directory named raw, and set its Resource type to raw. Inside that new folder, create a new file named dictionary.txt. Copy the content of dictionary.txt to this new file. Instead of the above model and controller, use

Before running your app, you need configure the device. Go to settings. Selects Apps. Find the Jumble App. Select Permissions. Enable Storage.

It remains to

The above can be accomplished in many different ways. Below, some hints are provided that may lead to one way to solve this problem. Note though that you are free to implement your model in other ways as well.

Each word has a "foot print." This foot print tells us for each character how many times that character occurs in the word. For example, the foot print of the word fewest is

(e, 2), (f, 1), (s, 1), (t, 1)
Note that the string seweft also has that foot print. More generally, one word is a jumble of another one if and only if they have the same foot print.

Questions you may consider to solve this lab:

Note that the number of lines of code that need to be added to the Dictionary class need not be more than 20.