Beispiel #1
0
        //Mesmo metodo de cima, POREM, com um novo parametro "posicoesPossiveis"

        public static void ImprimirTabuleiro(Tabuleiro tab, bool[,] possicoesPossiveis)
        {
            //Cores do background
            ConsoleColor fundoOriginal = Console.BackgroundColor;
            ConsoleColor fundoAlterado = ConsoleColor.DarkGray;



            for (int i = 0; i < tab.Linhas; i++)
            {
                Console.Write(8 - i + " ");

                for (int j = 0; j < tab.Colunas; j++)
                {
                    //Validando tipo de background
                    if (possicoesPossiveis[i, j])
                    {
                        Console.BackgroundColor = fundoAlterado;
                    }
                    else
                    {
                        Console.BackgroundColor = fundoOriginal;
                    }
                    ImprimirPeca(tab.PecaTab(i, j));
                    Console.BackgroundColor = fundoOriginal;
                }
                Console.WriteLine();

                ;
            }
            Console.WriteLine("  a b c d e f g h ");
            Console.BackgroundColor = fundoOriginal;
        }
Beispiel #2
0
        public static void ImprimirTabuleiro(Tabuleiro tab)
        {
            for (int i = 0; i < tab.Linhas; i++)
            {
                Console.Write(8 - i + " ");

                for (int j = 0; j < tab.Colunas; j++)
                {
                    ImprimirPeca(tab.PecaTab(i, j));
                }
                Console.WriteLine();

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