Check out Modern Chess, our featured variant for January, 2025.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

@ Bob Greenwade[All Comments] [Add Comment or Rating]
H. G. Muller wrote on Mon, Oct 2, 2023 05:42 AM UTC in reply to Bob Greenwade from Sun Oct 1 10:10 PM:

Such restrictions would be similar to a checking rule, making the difference between legal and pseudo-legal moves. Since the Diagram currently highlights pseudo-legal moves, they would only affect the AI.

The rule for not moving onto attacked squares is already implemented, as a generalization of the Chu-Shogi Lion-capture rule. The latter is implemented by temporarily designating the capturing piece as (absolute) royal, so that having exposed it to capture would be considered illegal. The capture matrix allows you to invoke this in a type-specific way, and you could specify it for the silent piece for capture of anything, including the empty square (i.e. the non-captures).

The 'second attacker' rule is more complex; the easiest way to implement it would be replacement of the main loop of the move generator by one that first generates all moves except the captures of the silent piece (which would be the normal one if we just don't define any captures at all on the silent piece). This should then be followed by a scan through the generated move list to see which enemy pieces have captures on them, and then generating capture moves of the silent piece exclusively on those. Or perhaps do the first move generation including all captures of the silent piece, and the do two scans through the move list: one to identify victims of captures by other pieces, and then to delete all captures of the silent piece of other victims than those. In any case this would involve a fairly large amount of custom scripting.

This all assumes that the requirement of a second attacker means a second pseudo-legal attacker. If the second attack would have to be fully legal, it would become far more complex, as you would have to figure out which captures in the move list expose your King, which requires searching one half-move further ahead, and generating the opponent reply to each of your captures there.

Chicken Pawns are also worse; these cannot be implemented by post-editing of your own move list, but are also dependent on opponent moves. I don't recall what the exact rules for these are, in particular what happens if they cannot withdraw, or can only withdraw to squares that are also under attack. If you would lose in that case they are simply royal pieces. Perhaps except that they might not use their forward moves for getting out of check, which would e similar to not being allowed to castle out of check.