Ejemplo n.º 1
0
        public static void ImprimirTabuleiro(Tabuleiro.Tabuleiro tabuleiro, bool[,] posicoesPossiveis)
        {
            ConsoleColor originalBackground = Console.BackgroundColor;
            ConsoleColor alteredBackground  = ConsoleColor.DarkGray;

            for (int i = 0; i < tabuleiro.Linhas; i++)
            {
                Console.BackgroundColor = originalBackground;
                Console.Write($"{8 - i} ");

                for (int j = 0; j < tabuleiro.Colunas; j++)
                {
                    if (posicoesPossiveis[i, j])
                    {
                        Console.BackgroundColor = alteredBackground;
                    }

                    ImprimirPeca(tabuleiro.GetPeca(i, j));

                    if (Console.BackgroundColor != originalBackground)
                    {
                        Console.BackgroundColor = originalBackground;
                    }
                }

                Console.WriteLine();
            }

            Console.BackgroundColor = originalBackground;
            Console.WriteLine("  a b c d e f g h");
        }
Ejemplo n.º 2
0
        public static void ImprimirTabuleiro(Tabuleiro.Tabuleiro tabuleiro)
        {
            for (int i = 0; i < tabuleiro.Linhas; i++)
            {
                Console.Write($"{8 - i} ");
                for (int j = 0; j < tabuleiro.Colunas; j++)
                {
                    ImprimirPeca(tabuleiro.GetPeca(i, j));
                }

                Console.WriteLine();
            }

            Console.WriteLine("  a b c d e f g h");
        }