Joggle Help

This is a terse explanation of some of the code that has been supplied in various Joggle classes. If you're implementing a standalone JoggleAL, or your own Joggle Program (single user) not derived from JoggleAL , this may be relevant.

The code in JoggleReader.java or FastJoggleReader.java (see the Joggle Web Page for code details) will load either a Vector or Trie with the words in the boggle dictionary. I don't see any reason to store all the words in a vector, but you certainly can. In any case, it doesn't really matter where the words are stored. Once you've stored words, you can use various member functions to determine if a word is in the dictionary or on the board (these are useful for different things).

If you use the Trie, there is a member function isWord(String s) you can use to determine if a string is stored in the trie. If you want to find where a string is on the board, use the isWord()/checkString() combination of functions from JoggleGraph.java, but note that there's a line of code missing from older version --- the myVisited array isn't reset at the end fo the function checkString() before false is returned (the code is fixed in the HTML accessible class).

To find the actual cubes, you'll need to use an array similar to myVisited (as Tafawa pointed out in a news post, the last cube that forms a word isn't marked in the JoggleGraph function checkString, you'll need to do this.) In any case, you'll need to adapt the code in JoggleGraph to suit your purposes. Probably the only code you can use "out of the box" is the FastJoggleReader (or slow reader) code.

As far as the Trie class goes: I don't think you need to implement your own Recorder classes, but you can. I implemented the Recorder interface to make it easier to do something to every element in a Trie, and to make Tries support the kind of Apply from C++ hashtable classes we used earlier in the semester.