Method FillGridWithWords
FillGridWithWords(IGrid<GridPoint2, string>, IWordAlphabet, IEnumerable<Word>, Func<GridPoint2, int, bool, GridPoint2>, int, IRandom)
Fills a grid with a given collection of words, providing the valid reading directions for the words
public static List<Word> FillGridWithWords(IGrid<GridPoint2, string> grid, IWordAlphabet alphabet, IEnumerable<Word> words, Func<GridPoint2, int, bool, GridPoint2> directionFunction, int directionCount, IRandom random)
Parameters
gridIGrid<GridPoint2, string>The grid to fill. Must be a grid of strings
alphabetIWordAlphabetThe alphabet to use
wordsIEnumerable<Word>The words to attempt to place inside the grid
directionFunctionFunc<GridPoint2, int, bool, GridPoint2>A function to walk the given grid in a direction specified by some index
directionCountintThe number of valid indices to
directionFunctionrandomIRandomThe random generator to use.
Returns
Remarks
This function will not clear the grid in advance. It will attempt to place words in null or empty cells in the grid, around existing elements if they exist. It is not guaranteed to fit all the words in the grid
FillGridWithWords(AbstractGrid<GridPoint2, string>, IWordAlphabet, IEnumerable<Word>, IRandom)
Fills a grid with a given collection of words
public static List<Word> FillGridWithWords(AbstractGrid<GridPoint2, string> grid, IWordAlphabet alphabet, IEnumerable<Word> words, IRandom random)
Parameters
gridAbstractGrid<GridPoint2, string>The grid to fill. Must be a grid of strings
alphabetIWordAlphabetThe alphabet to use
wordsIEnumerable<Word>The words to attempt to place inside the grid
randomIRandomThe random generator to use.
Returns
Remarks
This function will not clear the grid in advance. It will attempt to place words in null or empty cells in the grid, around existing elements if they exist. It is not guaranteed to fit all the words in the grid