nozaq / shogi-rs

A Bitboard-based shogi library in Rust. Board representation, move generation/validation and time control utilities.
https://docs.rs/shogi/latest/shogi/
MIT License
46 stars 3 forks source link

Fix Uchifuzume check #41

Closed sugyan closed 2 years ago

sugyan commented 2 years ago

image

In the case like the above figure, even if the pawn was dropped at the position of 2b, the king should be able to evade to 1a, but 1a is considered to be attacked by the bishop and the king could not move and returned a Uchifuzume error. I fixed it to judge if the king can evade after considering that the state of occupied_bb is changed by the dropped pawn.

nozaq commented 2 years ago

@sugyan LGTM! Thank you for adding a test case as well 👍🏼

nozaq commented 2 years ago

Just published v0.12.1.