AdvancedAlgorithms.WheresWaldorf.FindWordStartingFromCharacter C# (CSharp) Method

FindWordStartingFromCharacter() static private method

After finding the first character, continues on
static private FindWordStartingFromCharacter ( int lineInSearch, int positionInSearch, char grid, int foundCharacters, string wordToFind ) : bool
lineInSearch int
positionInSearch int
grid char
foundCharacters int
wordToFind string
return bool
        static bool FindWordStartingFromCharacter(int lineInSearch, int positionInSearch, char[][] grid, int foundCharacters, string wordToFind)
        {
            if (foundCharacters == wordToFind.Length)
            {
                //we're at the end, found them all
                return true;
            }
            int startingLineInSearch = lineInSearch;
            int startingPositionInSearch = positionInSearch;
            //look above, even, below lines
            for (int x = -1; x <= 1; x++)
            {
                lineInSearch = startingLineInSearch + x;
                //look left center right
                for (int y = -1; y <= 1; y++)
                {
                    positionInSearch = startingPositionInSearch + y;
                    if (x == 0 && y == 0)
                    {
                        //searching the same character, skip it
                        continue;
                    }

                    if (grid[lineInSearch][positionInSearch] == wordToFind[foundCharacters])
                    {
                        //found the second character, check from this point on recursively
                        bool result = CheckLine(grid, lineInSearch, positionInSearch, x, y, foundCharacters + 1,
                                                wordToFind);
                        if (result)
                            return true;

                    }
                }
            }

            return false;
        }