예제 #1
0
        private static void FlattenExample()
        {
            int[,] array = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
            var result = ArrayUnit.Flatten(array);

            foreach (var element in result)
            {
                Console.Write(element + " ");
            }
        }
예제 #2
0
        private static void DiagonalExample()
        {
            int[,] array = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
            var result = ArrayUnit.Diagonal(array);

            foreach (var element in result)
            {
                Console.WriteLine(element);
            }
        }
예제 #3
0
        private static void TriangularizelExample()
        {
            int[,] array = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
            var result = ArrayUnit.Triangularize(array);

            for (var row = 0; row < result.GetLength(0); row++)
            {
                for (var col = 0; col < result.GetLength(1); col++)
                {
                    Console.Write(result[row, col]);
                }

                Console.WriteLine();
            }
        }