server / Modules / search / Search
Class: Search
search.Search
Search is a singleton containing the search algorithm It is used to find the suggestions
Constructors
constructor
• new Search()
Methods
findWords
▸ findWords(«destructured»): Promise<SearchResult>
Entry point of the search algo
Parameters
| Name | Type |
|---|---|
«destructured» | Object |
› coord | Vec |
› dir | Direction |
› grid | Grid |
› method | "simple" | "fastest" |
Returns
Promise<SearchResult>
Defined in
getBestWords
▸ getBestWords(«destructured»): Object
Returns all the words that would not block the grid on next step
Parameters
| Name | Type |
|---|---|
«destructured» | Object |
› dir | Direction |
› grid | Grid |
› lemmes | Lemme[] |
› length | number |
› start | Point |
› words | string[] |
Returns
Object
a list of words that match the perpandicular lemmes
| Name | Type |
|---|---|
impossible | Point[] |
words | string[] |
Defined in
getLemmes
▸ Static getLemmes(«destructured»): any[]
Given a position and a direction, get all the lemmes Usefull for search algo
Parameters
| Name | Type |
|---|---|
«destructured» | Object |
› coord | Point |
› dir | Direction |
› grid | Grid |
› wordLength | number |
Returns
any[]
A list of lemmes of length 2 and 3