💡📝H. G. Muller wrote on Fri, Dec 18, 2020 04:33 PM UTC:
Ah, I think I got it. In the generated Pre-Game code this is fishy:
set partners (f1 d1 f10 d10); // 'rook' locations for castling
This mentions the Queen as possible castling partner, and apparently the move generator doesn't explicitly test for the occupant of the King target, as it assumes the King could not 'see' the Rook when that square is occupied in the first place. (Note that Fischer castling is not supported.) The move take-back during legality testing for highlighting purposes (which does run in the initial position!) apparently counts on the King target being empty, and doesn't put the victim back.
I am not sure how the Applet could have generated this partner set. The values are strange; they seem to apply to the 8x8 board, in absence of any pieces. (By default it is the most-distant piece.)
Another thing that is fishy is that the King table also contains vertical castlings. You must have forgotten to put the s modifier on the O3. This doesn't really hurt, as the piece in front of the King is not in the 'partner' set. It just wastes some time.
Ah, I think I got it. In the generated Pre-Game code this is fishy:
This mentions the Queen as possible castling partner, and apparently the move generator doesn't explicitly test for the occupant of the King target, as it assumes the King could not 'see' the Rook when that square is occupied in the first place. (Note that Fischer castling is not supported.) The move take-back during legality testing for highlighting purposes (which does run in the initial position!) apparently counts on the King target being empty, and doesn't put the victim back.
I am not sure how the Applet could have generated this partner set. The values are strange; they seem to apply to the 8x8 board, in absence of any pieces. (By default it is the most-distant piece.)
Another thing that is fishy is that the King table also contains vertical castlings. You must have forgotten to put the s modifier on the O3. This doesn't really hurt, as the piece in front of the King is not in the 'partner' set. It just wastes some time.