@@ -0,0 +1,792 @@
+package wordcram;%0A%0Apublic class WordBag implements WordSource %7B%0A%0A  int numWords;%0A  String%5B%5D wordStrings;%0A  double weightDistributionPower = 2;%0A%0A  public WordBag(int numWords, String... wordStrings) %7B%0A    this.numWords = numWords;%0A    this.wordStrings = wordStrings;%0A  %7D%0A%0A  public WordBag weightDistributionPower(float wdp) %7B%0A    this.weightDistributionPower = wdp;%0A    return this;%0A  %7D%0A%0A  public Word%5B%5D getWords() %7B%0A    Word%5B%5D words = new Word%5BnumWords%5D;%0A    java.util.Random rand = new java.util.Random();%0A    %0A    for (int i = 0, wi = 0; i %3C words.length; i++, wi = (wi + 1) %25 wordStrings.length) %7B%0A      String word = wordStrings%5Bwi%5D;%0A      double weight = Math.pow(rand.nextDouble(), weightDistributionPower);%0A      words%5Bi%5D = new Word(word, (float)weight);%0A    %7D%0A    return words;%0A  %7D%0A%7D%0A

Add WordBag, the first new WordSource.