コード例 #1
0
ファイル: SudokuBoard.cs プロジェクト: benin/LeetCode
        private bool CheckCols()
        {
            for (int col = 0; col < BoardSize; ++col)
            {
                var setValidator = new SetValidator(Col(col));
                if (!setValidator.IsUnique)
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #2
0
ファイル: SudokuBoard.cs プロジェクト: benin/LeetCode
        private bool CheckRows()
        {
            for (int row = 0; row < BoardSize; ++row)
            {
                var setValidator = new SetValidator(Row(row));
                if (!setValidator.IsUnique)
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #3
0
ファイル: SudokuBoard.cs プロジェクト: benin/LeetCode
        private bool CheckSquares()
        {
            const int squareSize = 3;

            for (int row = 0; row < squareSize; ++row)
            {
                for (int col = 0; col < squareSize; ++col)
                {
                    var setValidator = new SetValidator(SubSquare(row, col));
                    if (!setValidator.IsUnique)
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }