/* vim: set expandtab tabstop=4 shiftwidth=4 : */ public class BoggleSolver { // assume each word in the dictionary contains only [A-Z] public BoggleSolver(String[] dictionary) { } // Returns the set of all valid words in the given Boggle board public Iterable getAllValidWords(BoggleBoard board) { return null; } // Returns the score if it is in the dictionary, zero otherwise. // assume the word contains only [A-Z] public int scoreOf(String word) { return -1; } public static void main(String[] args) { In in = new In(args[0]); String[] dictionary = in.readAllStrings(); BoggleSolver solver = new BoggleSolver(dictionary); BoggleBoard board = new BoggleBoard(args[1]); int score = 0; for (String word : solver.getAllValidWords(board)) { StdOut.println(word); score += solver.scoreOf(word); } StdOut.println("Score = " + score); } }