| java.lang.Object com.toy.anagrams.lib.WordLibrary
WordLibrary | final public class WordLibrary (Code) | | Logic for the Anagram Game application.
|
Method Summary | |
public static String | getScrambledWord(int idx) Gets the word at a given index in its scrambled form. | public static int | getSize() Gets the number of words in the library. | public static String | getWord(int idx) Gets the word at a given index. | public static boolean | isCorrect(int idx, String userGuess) Checks whether a user's guess for a word at the given index is correct. |
getScrambledWord | public static String getScrambledWord(int idx)(Code) | | Gets the word at a given index in its scrambled form.
Parameters: idx - index of required word word at that index in its scrambled form |
getSize | public static int getSize()(Code) | | Gets the number of words in the library.
the total number of plain/scrambled word pairs in the library |
getWord | public static String getWord(int idx)(Code) | | Gets the word at a given index.
Parameters: idx - index of required word word at that index in its natural form |
isCorrect | public static boolean isCorrect(int idx, String userGuess)(Code) | | Checks whether a user's guess for a word at the given index is correct.
Parameters: idx - index of the word guessed Parameters: userGuess - the user's guess for the actual word true if the guess was correct; false otherwise |
|
|