CS 257: Software Design

WordGameAssistant, Phase 3 of 3

Continue with your partner, one more time.

For this assignment, you will complete an implementation of the WordGameAssistant application, as described below.

The WordGameAssistant class from last time will be a big help, but you will now need to add facilities for parsing the command line arguments and, for some operations, converting strings (not just single characters) into various forms. You now need to add a main method to WordGameAssistant to enable you to run WordGameAssistant as an independent program (unlike with Phase 2, where you used the JUnit test infrastructure to instantiate objects and invoke methods).

You may find yourself adding utility methods to your WordGameAssistant class. If so, for each non-trivial method you add, you should add at least one unit test method.

WordGameAssistant's command-line syntax

java WordGameAssistant [--dictionary=path-to-dictionary-file] action letters

The legal values for action are: words, use-all-letters, allow-repetition, and regex. These actions correspond to the four WordGameAssistant methods wordsUsingOnlyLetters, wordsUsingAllLetters, wordsUsingLettersAllowingRepetition, and wordsMatchingRegularExpression, respectively. In each case, the program should print to standard output (i.e. System.out) a list of words, one per line, ordered from longest word to shortest (and ordered alphabetically for same-length words--see the comment on wordListOrderedBySize).

The optional --dictionary flag allows you to explicitly specify your dictionary file. If the --dictionary option is not included, WordGameAssistant should (try to) use a dictionary file named "dictionary.txt" in the current working directory (which will typically be the same directory as the WordGameAssistant.class file when you execute the "java WordGameAssistant ..." command).

Usage examples

In each of these cases, I'm assuming that dictionary.txt file is the this one referenced in phase 2. Also, the $ at the beginning of each example represents your command-line program's prompt. You don't type it.

Handing it in

Submit your program by committing it to your bitbucket repository and tagging it with a tag named "phase3".

Have fun!