pegasus975

Program.cs

Jun 22nd, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.09 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Viernes
  8. {
  9.     class Program
  10.     {
  11.        
  12.         static void Main(string[] args)
  13.         {
  14.            
  15.            //VERIFICAR
  16.             Console.WriteLine("Digite a coordenada x.");
  17.             int xDig = Convert.ToInt32(Console.ReadLine());
  18.             Console.WriteLine("Digite a coordenada y.");
  19.             int yDig = Convert.ToInt32(Console.ReadLine());
  20.            
  21.             //POG
  22.             Console.WriteLine("Digite alguns comandos, 'E'squerda, 'D'ireita, 'A'vançar.");
  23.             String str = Console.ReadLine();
  24.             str = str.ToUpper();
  25.             char[] Comands = str.ToCharArray();
  26.             Console.WriteLine(" Olá {0}", Comands);
  27.  
  28.             //
  29.             SpaceCar sp = new SpaceCar(xDig, yDig);
  30.            
  31.             foreach (var separaLetras in Comands)
  32.             {
  33.                 switch (separaLetras)
  34.                 {
  35.                     case 'E':
  36.                         sp.girarEsquerda();
  37.                     break;
  38.                     case 'D':
  39.                         sp.girarDireita();
  40.                     break;
  41.                     case 'A':
  42.                         sp.avancarBloco(xDig, yDig);
  43.                     break;
  44.                 }
  45.             }
  46.            
  47.            
  48.            
  49.            
  50.             //MATRIZ
  51.             int[,] marte = new int[6, 6];
  52.            
  53.             //preenchendo a matriz
  54.            /* for (int i = 5; i >= 0; i--)
  55.             {
  56.                 for (int j = 5; j >= 0; j--)
  57.                 {
  58.                     marte[i, j] = i + j;
  59.                 }
  60.             }
  61.             //mostrar matriz
  62.             for (int i = 5; i >= 0; i--)
  63.             {
  64.                 for (int j = 5; j >= 0; j--)
  65.                 {
  66.                     Console.Write(" "+ marte[i,j]);
  67.                 }
  68.                 Console.WriteLine("\n");
  69.             }*/
  70.             Console.WriteLine("Press Any Key to Exit");
  71.             Console.ReadKey();
  72.         }
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment