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
grid
IGrid<GridPoint2, string>The grid to fill. Must be a grid of strings
alphabet
IWordAlphabetThe alphabet to use
words
IEnumerable<Word>The words to attempt to place inside the grid
directionFunction
Func<GridPoint2, int, bool, GridPoint2>A function to walk the given grid in a direction specified by some index
directionCount
intThe number of valid indices to
directionFunction
random
IRandomThe 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
grid
AbstractGrid<GridPoint2, string>The grid to fill. Must be a grid of strings
alphabet
IWordAlphabetThe alphabet to use
words
IEnumerable<Word>The words to attempt to place inside the grid
random
IRandomThe 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