예제 #1
0
 public static void printBoard(Board board)
 {
     for (int i = 0; i < board.Lines; i++)
     {
         Console.Write(8 - i + " ");
         for (int j = 0; j < board.Columns; j++)
         {
             printPiece(board.getPiece(i, j));
         }
         Console.WriteLine();
     }
     Console.WriteLine("  a b c d e f g h");
 }
예제 #2
0
        internal static void printBoard(Board board, bool[,] possiblePositions)
        {
            ConsoleColor originalBackground = Console.BackgroundColor;
            ConsoleColor alteredBackground  = ConsoleColor.DarkGray;

            for (int i = 0; i < board.Lines; i++)
            {
                Console.Write(8 - i + " ");
                for (int j = 0; j < board.Columns; j++)
                {
                    Console.BackgroundColor = possiblePositions[i, j] ? alteredBackground : originalBackground;
                    printPiece(board.getPiece(i, j));
                    Console.BackgroundColor = originalBackground;
                }
                Console.WriteLine();
            }
            Console.WriteLine("  a b c d e f g h");
            Console.BackgroundColor = originalBackground;
        }