H. G. Muller wrote on Wed, Jun 5, 2024 05:50 PM UTC:
I guess there has always ben a distinction between what the I.D. can do through configuring it, and what it can do through additional scripting. The latter was really never documented, as I considered scripting too difficult for the intended users anyway. So it was mainly a feature for making my own life easy. And it involved in a non-backward-compatible way. Documenting it sort of forces you to remain compatible with the documentation.
I did just get an idea, though. There could be a new symbol in the captureMatrix for indicating 'tentative' moves. These then would not be added to the move list right away, but be stored in a separate list. When this list is non-empty after the move generation completed, a custom routine would be called that could process them further. This would be useful for moves the legality of which would depend on a global condition. Such as mandatory capture: all non-captures would be marked as tentative, and the custom routine could copy them all to the real move list if the latter was still empty (i.e. if there were no captures), and discard them otherwise.
A multi-square piece would then be represented by a single 'master piece', and a number of dummies. The latter would have no move of their own. All moves of the master piece, as well as any capture of it, or of a dummy, would be defined as tentative in the captureMatrix. The custom routine could then judge (1) whether moves of the master piece have the required target occupance of th entire target area (and then modify the move by adding the moves of all dummies to it before accepting it), and (2) test for the captures whether the tentative moves include captures to all components of the piece, and only accept those if that is the case (and the add all components that were not on the target square as locust victims of the move).
I guess there has always ben a distinction between what the I.D. can do through configuring it, and what it can do through additional scripting. The latter was really never documented, as I considered scripting too difficult for the intended users anyway. So it was mainly a feature for making my own life easy. And it involved in a non-backward-compatible way. Documenting it sort of forces you to remain compatible with the documentation.
I did just get an idea, though. There could be a new symbol in the captureMatrix for indicating 'tentative' moves. These then would not be added to the move list right away, but be stored in a separate list. When this list is non-empty after the move generation completed, a custom routine would be called that could process them further. This would be useful for moves the legality of which would depend on a global condition. Such as mandatory capture: all non-captures would be marked as tentative, and the custom routine could copy them all to the real move list if the latter was still empty (i.e. if there were no captures), and discard them otherwise.
A multi-square piece would then be represented by a single 'master piece', and a number of dummies. The latter would have no move of their own. All moves of the master piece, as well as any capture of it, or of a dummy, would be defined as tentative in the captureMatrix. The custom routine could then judge (1) whether moves of the master piece have the required target occupance of th entire target area (and then modify the move by adding the moves of all dummies to it before accepting it), and (2) test for the captures whether the tentative moves include captures to all components of the piece, and only accept those if that is the case (and the add all components that were not on the target square as locust victims of the move).