public void TestCreateMatrixWithSizeIfInputIsCorect()
 {
     MatrixCreator matrixCerator = new MatrixCreator();
     int size = 6;
     int[,] matrix = new int[size, size];
     Assert.AreEqual(size, matrix.GetLength(0));
 }
예제 #2
0
        public static void Main()
        {
            MatrixCreator matrixCerator = new MatrixCreator();

            int matrixSize = matrixCerator.GetMatrixSize();

            int[,] matrix = new int[matrixSize, matrixSize];

            MatrixWalker matrixWalker = new MatrixWalker();

            int positionIndex = 1;

            int positionX = 0;
            int positionY = 0;

            int stepInDirectionX = 1;
            int stepInDirectionY = 1;

            matrixWalker.ConstructMatrix(matrix, ref positionIndex, ref positionX, ref positionY, ref stepInDirectionX, ref stepInDirectionY);

            matrixCerator.PrintMatrix(matrix);
        }