Example #1
0
        public static void ImprimirTabuleiro(tabuleiro tab, bool[,] posicoesPossiveis)
        {
            ConsoleColor Original = Console.BackgroundColor;
            ConsoleColor fundoNew = ConsoleColor.DarkGray;

            for (int i = 0; i < tab.Linha; i++)
            {
                Console.Write(8 - i + "  ");
                for (int j = 0; j < tab.Coluna; j++)
                {
                    if (posicoesPossiveis[i, j])
                    {
                        Console.BackgroundColor = fundoNew;
                    }
                    else
                    {
                        Console.BackgroundColor = Original;
                    }
                    ImprimirPeca(tab.Peca(i, j));
                    Console.BackgroundColor = Original;
                }
                Console.WriteLine();
            }
            Console.WriteLine("  a b c d e f g h");
            Console.BackgroundColor = Original;
        }
Example #2
0
 public static void ImprimirTabuleiro(tabuleiro tab)
 {
     for (int i = 0; i < tab.Linha; i++)
     {
         Console.Write(8 - i + " ");
         for (int j = 0; j < tab.Coluna; j++)
         {
             if (tab.Peca(i, j) == null)
             {
                 Console.Write("- ");
             }
             else
             {
                 ImprimirPeca(tab.Peca(i, j));
                 Console.Write("");
             }
         }
         Console.WriteLine();
     }
     Console.WriteLine("  a b c d e f g h");
 }