public static void PrintTable(TableClass table, bool[,] possiblePositions) { Console.SetCursorPosition(0, 0); ConsoleColor originalBackground = Console.BackgroundColor; ConsoleColor alterBackGround = ConsoleColor.DarkGray; for (int i = 0; i < table.Lines; i++) { Console.Write(8 - i + "|"); for (int j = 0; j < table.Columns; j++) { if (possiblePositions[i, j]) { Console.BackgroundColor = alterBackGround; } else { Console.BackgroundColor = originalBackground; } PrintPiece(table.PieceMethod(i, j)); Console.BackgroundColor = originalBackground; } Console.WriteLine(); } Console.WriteLine(" a b c d e f g h"); Console.BackgroundColor = originalBackground; }
public static void PrintTable(TableClass table) { ConsoleColor originalBackground = Console.BackgroundColor; for (int i = 0; i < table.Lines; i++) { Console.Write(8 - i + "|"); for (int j = 0; j < table.Columns; j++) { PrintPiece(table.PieceMethod(i, j)); } Console.WriteLine(); } Console.WriteLine(" a b c d e f g h"); }