diff --git a/src/com/toy/anagrams/lib/StaticWordLibrary.java b/src/com/toy/anagrams/lib/StaticWordLibrary.java index 93e286f..824a42d 100644 --- a/src/com/toy/anagrams/lib/StaticWordLibrary.java +++ b/src/com/toy/anagrams/lib/StaticWordLibrary.java @@ -31,6 +31,8 @@ package com.toy.anagrams.lib; +import java.util.Random; + /** * Implementation of the logic for the Anagram Game application. */ @@ -153,9 +155,38 @@ public String getWord(int idx) { * @param idx index of required word * @return word at that index in its scrambled form */ - public String getScrambledWord(int idx) { - return SCRAMBLED_WORD_LIST[idx]; - } + public String getScrambledWord(int idx, int count) { + //return SCRAMBLED_WORD_LIST[idx]; + String word = WORD_LIST[idx]; + char[] shuffle = new char[word.length()]; + + for(int i=0; i