Beispiel #1
0
        private static void FindNextCell(int currentRow, int currentCol, MatrixInfo matrixInfo)
        {
            if (!IsInside(currentRow, currentCol) || matrix[currentRow][currentCol] != '-')
            {
                return;
            }

            matrix[currentRow][currentCol] = '0';
            matrixInfo.IncrementSize();

            FindNextCell(currentRow - 1, currentCol, matrixInfo);

            FindNextCell(currentRow + 1, currentCol, matrixInfo);

            FindNextCell(currentRow, currentCol - 1, matrixInfo);

            FindNextCell(currentRow, currentCol + 1, matrixInfo);
        }