A. M. DeWitt wrote on Fri, Oct 27, 2023 02:29 PM UTC:
I noticed a bug with the matedbypawn subroutine in the fairyshogi include file.
Specifically, if the King is unable to move anywhere (due to moving into check or otherwise), the subroutine thinks that a Pawn cannot be dropped to check the King, even if this does not actually result in mate.
1. p 5g-5f
1... P 5c-5d
2. g 4i-4h
2... G 6a-6b
3. g 4h-5g
3... G 6b-5c
4. g 5g-4f
4... G 5c-6d
5. g 4f-4e
5... G 6d-6e
6. g 4e-5d
6... G 6e-5f
7. g 5d-5c
7... G 5f-5g
8. s 3i-3h
8... S 7a-7b
9. s 3h-4i
9... S 7b-6a // After this move, Pawn drop checks are not marked as legal, even though 3 pieces can capture the checking Pawn afterward.
I noticed a bug with the matedbypawn subroutine in the fairyshogi include file.
Specifically, if the King is unable to move anywhere (due to moving into check or otherwise), the subroutine thinks that a Pawn cannot be dropped to check the King, even if this does not actually result in mate.
Here's an example of the bug from Shogi:
1. p 5g-5f
1... P 5c-5d
2. g 4i-4h
2... G 6a-6b
3. g 4h-5g
3... G 6b-5c
4. g 5g-4f
4... G 5c-6d
5. g 4f-4e
5... G 6d-6e
6. g 4e-5d
6... G 6e-5f
7. g 5d-5c
7... G 5f-5g
8. s 3i-3h
8... S 7a-7b
9. s 3h-4i
9... S 7b-6a // After this move, Pawn drop checks are not marked as legal, even though 3 pieces can capture the checking Pawn afterward.