Date post: | 14-Apr-2017 |
Category: |
Education |
Upload: | harsh-vakharia |
View: | 217 times |
Download: | 0 times |
WHAT IS AN ANAGRAM?An anagram is a word formed by rearranging the letters of another
word.— Wikipedia
MECHANICS1. Provide user a word from the dictionary.
2. The user tries to create as many words as possible that contain all the letters of the given word plus one additional letter.
3. The user can give up and see the words that they did not guess.
CATCHThe addition of extra letter at the beginning or the end without
reordering the other letters is not valid.
MEANINGIf the game picks the word 'ore' as a starter, the user might guess
'rose' or 'zero' but not 'sore'.
i.e.
1. rose ✅2. s(ore) ❌
ANAGRAMDICTIONARY'S CONSTRUCTORWHAT IS NEEDED?
1. Word validation2. Random word selection3. Get word's anagrams
4. Get words by length (ext)
GET WORD'S ANAGRAMSMap<String, ArrayList<String>> lettersToWord = new HashMap<>();
ACCESS TIME: O(1)
RULES1. if they roll a 1, score no points and lose their turn
2. if they roll a 2 to 6:▸ add the rolled value to their points
▸ choose to either reroll or keep their score and end their turn