Beispiel #1
0
        public static void Executar()
        {
            Coordenada coordenadaInicial;

            coordenadaInicial.X = 2;
            coordenadaInicial.Y = 2;

            var coordenadaFinal = new Coordenada(x: 9, y: 1);

            coordenadaFinal.MoverNaDiagonal(10);
            Console.WriteLine(coordenadaFinal.X);
            Console.WriteLine(coordenadaFinal.Y);
        }
Beispiel #2
0
        public static void Executar()
        {
            Coordenada coordenadaInicial;

            coordenadaInicial.X = 2;
            coordenadaInicial.Y = 2;

            Console.WriteLine("X:" + coordenadaInicial.X + " Y:" + coordenadaInicial.Y);

            var coordenadaFinal = new Coordenada(x: 10, y: 5);

            coordenadaFinal.MoverNaDiagonal(15);

            Console.WriteLine("X: " + coordenadaFinal.X + " Y: " + coordenadaFinal.Y);
        }
        public static void Executar()
        {
            Coordenada CoordenadaInicial;

            CoordenadaInicial.X = 2;
            CoordenadaInicial.Y = 2;
            Console.WriteLine(CoordenadaInicial.X);
            Console.WriteLine(CoordenadaInicial.Y);

            var CoordenadaFinal = new Coordenada(9, 1);

            CoordenadaFinal.MoverDiagonal(10);
            Console.WriteLine(CoordenadaFinal.X);
            Console.WriteLine(CoordenadaFinal.Y);
        }
Beispiel #4
0
        public static void Executar()
        {
            Coordenada coordenadaInicial; // Não houve necessidade de atribuição a um objeto.

            coordenadaInicial.X = 2;
            coordenadaInicial.Y = 2;

            Console.WriteLine("Cooredenada Inicial:\nX = {0}\nY = {1}", coordenadaInicial.X, coordenadaInicial.Y);

            var coordenadaFinal = new Coordenada(9, 1);

            coordenadaFinal.MoverNaDiaginal(10);

            Console.WriteLine("Coordenada Final :\nX = {0}\nY= {1}", coordenadaFinal.X, coordenadaFinal.Y);
        }
Beispiel #5
0
        public static void Executar()
        {
            Coordenada coordenadaInicial;

            coordenadaInicial.X = 4;
            coordenadaInicial.Y = 3;
            Console.WriteLine("Coordenada inicial é: ");
            Console.WriteLine("X = {0}", coordenadaInicial.X);
            Console.WriteLine("Y = {0}", coordenadaInicial.Y);
            var coordenadaFinal = new Coordenada(x: 6, y: 8);

            coordenadaFinal.MoverNaDiagonal(10);
            Console.WriteLine("Coordenada final é: ");
            Console.WriteLine("X = {0}", coordenadaFinal.X);
            Console.WriteLine("Y = {0}", coordenadaFinal.Y);
        }
Beispiel #6
0
        public static void Executar()
        {
            Coordenada coordenadaInicial;

            coordenadaInicial.X = 2;
            coordenadaInicial.Y = 2;

            Console.WriteLine("Coodenada inicial: ");
            Console.WriteLine($"X = {coordenadaInicial.X}");
            Console.WriteLine($"Y = {coordenadaInicial.Y}");

            var coordenadaFinal = new Coordenada(x: 9, y: 1);

            coordenadaFinal.MoverNaDiagonal(10);
            Console.WriteLine($"X = {coordenadaFinal.X}");
            Console.WriteLine($"Y = {coordenadaFinal.Y}");
        }
Beispiel #7
0
        public static void Executar()
        {
            Coordenada coordenadaInicial;

            coordenadaInicial.X = 2;
            coordenadaInicial.Y = 2;

            Console.WriteLine("Coordenada Inicial:");
            Console.WriteLine("X = {0}", coordenadaInicial.X);
            Console.WriteLine("Y = {0}", coordenadaInicial.Y);

            var coordenadaFinal = new Coordenada(9, 1);

            coordenadaFinal.MoverNaDiagonal(10);
            Console.WriteLine("X = {0}", coordenadaFinal.X);
            Console.WriteLine("Y = {0}", coordenadaFinal.Y);
        }
Beispiel #8
0
        public static void Executar()
        {
            Coordenada coordenadaInicial;

            coordenadaInicial.X = 2;
            coordenadaInicial.Y = 2;

            Console.WriteLine("Coordenada Inicial:");
            Console.WriteLine("X = {0}", coordenadaInicial.X);
            Console.WriteLine("Y = {0}", coordenadaInicial.Y);

            var coordenadaFinal = new Coordenada(x: 9, y: 1);

            coordenadaFinal.MoverNaDiagonal(10); // delta vale 10 somando X e Y, Resultado 19 e 11

            Console.WriteLine("Coordenada Final:");
            Console.WriteLine("x = {0}", coordenadaFinal.X);
            Console.WriteLine("y = {0}", coordenadaFinal.Y);
        }
        public static void Executar()
        {
            Coordenada coordenadaInicial; //como o metodo Coordenda é do tipo struct, nao precisa instanciar

            coordenadaInicial.X = 2;
            coordenadaInicial.Y = 2;

            Console.WriteLine("Coordenada Inicial:");
            Console.WriteLine("X = {0}", coordenadaInicial.X);
            Console.WriteLine("Y = {0}", coordenadaInicial.Y);

            var coordenadaFinal = new Coordenada(x: 9, y: 1);

            coordenadaFinal.MoverNaDiagonal(10);

            Console.WriteLine("Coordenada Final:");
            Console.WriteLine("X = {0}", coordenadaFinal.X);
            Console.WriteLine("Y = {0}", coordenadaFinal.Y);
        }
Beispiel #10
0
        public static void Executar()
        {
            Coordenada coordenadaInicial;//n precisa usar o new

            coordenadaInicial.X = 2;
            coordenadaInicial.Y = 2;


            Console.WriteLine("Coordenada Inicial: ");
            Console.WriteLine("X: {0}", coordenadaInicial.X);
            Console.WriteLine("Y: {0}", coordenadaInicial.Y);

            var coordenadaFinal = new Coordenada(x: 9, y: 1);

            coordenadaFinal.MoverNaDiagonal(10);

            Console.WriteLine("Coordenada Inicial: ");
            Console.WriteLine("X: {0}", coordenadaFinal.X);
            Console.WriteLine("Y: {0}", coordenadaFinal.Y);
        }
Beispiel #11
0
        public static void Executar()
        {
            Console.WriteLine("|------------------------------------------------|");
            Console.WriteLine("|=================< Seção 05 >===================|");
            Console.WriteLine("|========< Classes & Metodos - Struc >===========|");
            Console.WriteLine("|------------------------------------------------|");
            //-----------------------------------------< Código da Aula >---------------------------------//

            Coordenada coordenadaInical;

            coordenadaInical.X = 2;
            coordenadaInical.Y = 2;

            Console.WriteLine($"X = {coordenadaInical.X}");
            Console.WriteLine($"Y = {coordenadaInical.Y}");

            var coordenadaFinal = new Coordenada(x: 9, y: 1);

            coordenadaFinal.MoverDiagonal(10);
            Console.WriteLine("Coordenada Final: ");

            Console.WriteLine($"X = {coordenadaFinal.X}");
            Console.WriteLine($"Y = {coordenadaFinal.Y}");
        }//Fim do Executar