It was necessary to solve the problem of bypassing the knight of the N * N board and display the solution. The algorithm is simple, I implemented it, but with the conclusion there were problems. The practitioner requires that the output be "through the interface." Unfortunately, I can’t say anything more specifically. I do not understand what is required. Suddenly, someone knows what it means, and will be able to explain, although I understand that there is little chance. Here is the console output function that does not satisfy it.
private static void Print(int boardSize, int[,] board) { for (int x = 0; x < boardSize; x++) { for (int y = 0; y < boardSize; y++) { Console.Write("{0:D2} ", board[x, y]); } Console.WriteLine(); } }
All I understood about the interfaces and this task is that it is required to create a separate class, to inherit it. Here is the only thing that I understood
interface Printer { void Print(string toPrint); } class ConsolePrinter : Printer { public static void Print(string format, object arg) { Console.Write(format, arg); } }
How now it (if it is of course correct) to transfer to the first function? Please do not zaminusovyvat, just write in the comments that I didn’t explain, try to tell. If the question is not logical at all, also do not minus pliz, but just warn