Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. public static String  findSingleWord (String letters)
  2.     {      
  3.         int counter = 0;
  4.         String [] list = new String[2000];
  5.         Scanner infile = OpenFile.openToRead("words.txt");
  6.         String temp = new String("");
  7.         while(infile.hasNext())
  8.         {
  9.             temp = infile.nextLine();
  10.             if(matchletters(temp, letters))
  11.             {
  12.                 list[counter] = temp;
  13.                 counter++;
  14.             }
  15.         }
  16.         String [] word = new String[counter];
  17.         for(int i = 0; i < counter; i++)
  18.         {
  19.             word[i] = list[i];
  20.         }
  21.         infile.close();
  22.         return bgestWord(word, scoretable);
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement