Beispiel #1
0
        public bool IsMagicSquare(int[][] square, int sum)
        {
            var HorizontalsState = IsValid(square, sum);

            if (NotLastDirection(HorizontalsState))
            {
                _nextDirection.IsMagicSquare(square, sum);
            }
            return(HorizontalsState);
        }
Beispiel #2
0
        public bool IsMagicSquare(int[][] square, int sum)
        {
            var diagonals      = GetDiagonals(square);
            var DiagonalsState = IsValid(diagonals, sum);

            if (NotLastDirection(DiagonalsState))
            {
                _nextDirection.IsMagicSquare(square, sum);
            }
            return(DiagonalsState);
        }
Beispiel #3
0
        public bool IsMagicSquare(int[][] square, int sum)
        {
            var verticals      = GetVerticals(square);
            var VerticalsState = IsValid(verticals, sum);

            if (NotLastDirection(VerticalsState))
            {
                _nextDirection.IsMagicSquare(square, sum);
            }
            return(VerticalsState);
        }