Ahhh! It is the return of the Word Search!!! However, any ideas on how to do it recursively?
n t o f u g i r l
h n d d c s e r c
e e b d u c s f e
l f e w e t s e e
p e s e w s e e e
e w w s b o o p f
f s j i w y b s e
Words to find:
tofugirl is located at column 2, row 1 - direction is right
help is located at column 1, row 1 - direction is down
Sorry for the alignment of the puzzle. I just made it up -- supposedly a 9 x 9 matrix.
I made it up as a 12 x 12 matrix to account for the null, and to take out the 0 rows & 0 columns (this doesn't happen in real life).
Account that words show up across (left to right or right to left), and down (left to right or right to left). no diagonals! (thank goodness!)
I have something using strstr and using as it != NULL as a base case... but I cannot figure out how to get rid of the traditional
for ( i = 0; i < rows; i++)
for(j = 0; j < columns; j++)
and make it recursive!
Any ideas??? Any code snippet would be much appreciated...
I have an idea there needs to be 4 functions to check for words - Across, Down, Backwards Across, and Backwards Down.