Reinhard Scharnagl wrote:Hi Uri,You do not need to validate all moves in legal move generator.
that seems to be a semantic problem - I think it would need a sort of validation in any case.If you find that a piece is not pinned then you can be sure that all of it's moves are legal.
With the exceptions of King moves, e.p. captures, and Fischer castlings, where the rook is pinned though it would move along the pinning line.
True, but these exceptions are so rare that you can handle them in the stupid and expensive way without a noticable slowdown. My legality tester simply makes the move, tests whether the moving side is in check, and unmakes the move again in the case of e.p. captures and Fischer castlings.
But to everything else I agree. There is a great benefit of having the full information to any move: capture, check with its direction, double-check, mate, e.p.-preparing double pawn step ...
This is all true, but why do you need to find this information when the moves are generated? Isn't it just as good to have simple and fast functions to compute this kind of information when needed? Instead of identifying a move as a double check during move generation, I would rather do an "if is_double_check(move) { ... }" if/when I need this information.
Overmore the engine procedures will of course become more transparent.
How? Could you give an example of pseudo code with and without this type of stuff computed in the move generator, and explain why you consider the former to be more transparent?
Tord