This exercise continues with TextTwist from
Exercise 7.
Once again, remind yourself about the real TextTwist
by trying it out for a few minutes.
Here's one
version of the game. You can google "TextTwist" to see
other versions.
As you can see, a scrambled word is presented to the user. The user
must not only guess the scrambled word, but also all "subwords",
valid words that can be spelled using letters from the original word.
In Exercise 7, you implemented code to find all valid subwords
of a given word. We will integrate that code into a GUI and
add a little more code to get our complete application:
- Download TextTwist.java and
read through it. All the GUI code has been written for you.
You will also need
WordTool.java and
words, the dictionary.
- You need to insert your subword-finding methods from Exercise 7.
- There are two more small pieces of code to write:
- Currently, there are only two words in the database of
original words (puzzles): "house" and "theory". Both have
been hard-coded into the program. You should substitute this
with code that populates the database (list) of words from
the dictionary. For example, you could add all words of
length between 5 and 8.
- Write a small method to permute the letters of a word.
You will see the method outlined for you in TextTwist.java.
Submission:
What else is due: