@@ Assume that the grid and the dictionary are global variables @@
rsearch(cell, subword):
Return if the current cell has been visited
Mark the current cell as visited
Append the current character to the subword
Output the subword if it is in the dictionary
Recursively call rsearch(...) for each of 8 adjacent cells
Remove the last character from the subword
search(start):
Call rsearch(...) for the starting cell
Comments
Leave a comment