A program that solves word search puzzles of arbitrary dimensions. It locates the start and end positions of all length 6 or longer words from a dictionary that appear horizontally, vertically, and diagonally, either forwards or backwards in the puzzle. Wraparounds are excluded.
Serial search is performed for each dictionary word length 6 or longer in every string in each vector, forwards and backwards. Words can only be found in diagonals if the puzzle has at least 6x6 dimensions.
Forwards:
// Search rows
// --------->
// --------->
// --------->
// Search columns
// | | |
// | | |
// V V V
// Search diagonals, if possible
// \ \ \ / / /
// \ \ \ and / / /
// V V V V V V
Backwards:
// Search rows
// <---------
// <---------
// <---------
// Search columns
// ^ ^ ^
// | | |
// | | |
// Search diagonals, if possible
// ^ ^ ^ ^ ^ ^
// \ \ \ and / / /
// \ \ \ / / /
"answers.txt" is generated to report found words alphabetically with start and end positions.