public class RandomWord { static String[] words; public static void main (String[] argv) { // This is the dictionary. words = WordTool.getDictionary (); // We'll try generating words of length 3 for now. int size = 3; int numTrials = generateWordRandomly (size); System.out.println ("It took " + numTrials + " trials to generate a word of length " + size); } static int generateWordRandomly (int size) { // We'll want to count the number of trials it took. int numTrials = 0; boolean done = false; while (! done) { // Generate a random word. String randomStr = generate (size); numTrials ++; // Check if it's in the dictionary. for (int i=0; i