public static void PrintChess(MyTable tab, bool[,] possibleMoves) { ConsoleColor originalBackground = Console.BackgroundColor; ConsoleColor newBackground = ConsoleColor.DarkGreen; for (int i = 0; i < tab.Rows; i++) { System.Console.Write(8 - i + " "); for (int j = 0; j < tab.Columns; j++) { if (possibleMoves[i, j]) { Console.BackgroundColor = newBackground; } else { Console.BackgroundColor = originalBackground; } PrintPiece(tab.GetPiece(i, j)); Console.BackgroundColor = originalBackground; } System.Console.WriteLine(); } System.Console.WriteLine(" " + "a b c d e f g h"); }
public static void PrintChess(MyTable tab) { for (int i = 0; i < tab.Rows; i++) { System.Console.Write(8 - i + " "); for (int j = 0; j < tab.Columns; j++) { PrintPiece(tab.GetPiece(i, j)); } System.Console.WriteLine(); } System.Console.WriteLine(" " + "a b c d e f g h"); }