wordfinder(words,
rows=20,
cols=20,
attempts=50,
alph=' ABCDEFGHIJKLMNOPQRSTUVWXYZ ' )
| source code
|
Attempt to arrange words into a letter-grid with the specified number
of rows and columns. Try each word in several positions and directions,
until it can be fitted into the grid, or the maximum number of allowable
attempts is exceeded. Returns a tuple consisting of the grid and the
words that were successfully placed.
- Parameters:
words (C(list)) - the list of words to be put into the grid
rows (C(int)) - the number of rows in the grid
cols (C(int)) - the number of columns in the grid
attempts (C(int)) - the number of times to attempt placing a word
alph (C(list)) - the alpabet, to be used for filling blank cells
- Returns: C(tuple)
|