-
-
Notifications
You must be signed in to change notification settings - Fork 236
Description
The parameter immobilityIllegal does not correctly account for pure hoppers/grasshoppers that can become trapped in certain regions of the board.
The way these moves work is that they must jump a piece in order to move. This means that by definition they cannot move to adjacent squares.
Preconditions: immobilityIllegal is true, and the variant has a trappable pure hopper/grasshopper. For this explanation I will use the move fpR.
Expected Behavior: fpR should not be able to move to the last two ranks without promoting to something that can move from there, no matter where it started from.
Actual Behavior as of this writing: the restrictions mentioned above are only applied to the last rank, not the last two.
Explanation: This is likely because immobilityIllegal does not take into account p and g modifiers in the Betza notation, and simply treats a hopping move as a normal sliding move.
Important Notes: This bug only applies if the trappable hopper/grasshopper does not have other moves available to it. For example, fmRfcpR should be treated like the Shogi Lance (restrictions only on last rank) due to the fmR part of the move.
You can test this in FairyGround with the following variant definition:
[immobility-illegal-hopper-test:shogi]
customPiece1 = m:fpR
customPiece2 = j:fC
promotedPieceType = p:g m:g j:g s:g b:h r:d
startFen = 2sgkgs2/1r5b1/p1ppppp1p/1p5p1/9/1P5P1/P1PPPPP1P/1B5R1/2SGKGS2[mmMMjjJJ]
Below are some screenshots of the bug in action.
