asrayousuf / ScrabbleWordRecommender

0 stars 0 forks source link

Find all possible strings from the input rack #18

Closed aravindsrivats closed 9 years ago

aravindsrivats commented 9 years ago

Compare and find all possible words from the anagram map for the particular input rack

aravindsrivats commented 9 years ago

Algorithm to find the words

for each word in dictionary: take first letter of rack if letter found in word remove letter from word and rack if word is empty possible_word.add(current word)

aravindsrivats commented 9 years ago

For blank spaces the algorithm is gonna work like this:

for each word in dictionary: take first letter of rack if letter found in word remove letter from word and rack if remaining length of word is equal to the number of blank spaces possible_word.add(current word)

asrayousuf commented 9 years ago

and where does anagram come into the scene.. now you search only the key of the anagram lis? and then add all the words that are there in the value?

aravindsrivats commented 9 years ago

Exactly. You dont need to check for each of the values!

aravindsrivats commented 9 years ago

We'll get the input from the second team module as (rack, number of blank spaces)

asrayousuf commented 9 years ago

Or we can have two overloaded functions

aravindram94 commented 9 years ago

Aravind ! if the second passes that to us wat wil they do?

aravindsrivats commented 9 years ago

We'll return the score of the word including the blank tile. They'll return the proper score after subtracting the scores of blank tiles.

aravindram94 commented 9 years ago

okay!

aravindram94 commented 9 years ago

what sld i do now?

aravindram94 commented 9 years ago

can v discuss the function signature?

aravindram94 commented 9 years ago

The function receives the rack and number of blanks as input and returns the list of possible words in an ArrayList as output is done