Hi all! I found in my book a "class" example, not complete, that I am unable to complete since I know almost nothing about chessboard. This example seems to me much more interesting than the example I find in the tutorials of this forum. Here is the code.
at the very least, getPiece and getMove should be const, and makeMove should take something more specific than four arbitrary integers. Either a proper chess move description, or at least two board positions (so you don't have to check that they are not negative and not exceed 8).
You also need other state to determine next move validity, such as total number of moves taken, number of moves since the last repetition, whether the king had moved previously, etc - and, in fact, the full list of moves should be kept, and the ability to roll back for analysis... making a realistic setup for a chess engine can get fairly complicated even if it's just to serve two human players.
Thank you, Cubbi, for your reply. There must be hundreds of creators of chessboard programs, but none of them looks at this forum. Maybe, to-morrow, someone will appear !