fairy-stockfish / Fairy-Stockfish

chess variant engine supporting Xiangqi, Shogi, Janggi, Makruk, S-Chess, Crazyhouse, Bughouse, and many more
https://fairy-stockfish.github.io/
GNU General Public License v3.0
612 stars 191 forks source link

Betza Notation of Non-Knight Riders #499

Open DSARichard opened 2 years ago

DSARichard commented 2 years ago

I noticed that rider/slider Betza notation seems only to work for knights.

knight = n:N # this of course is a knight customPiece1 = n:N0 # this defines a knight rider, which also works however... customPiece2 = l:L # this of course is a camel customPiece3 = l:L0 # this tries to define a camel rider, but fails: the calculation gives not a single move customPiece4 = l:L1 # this also does not work customPiece5 = j:J2 # etc.

Of course, it is explicitly stated: In Fairy-Stockfish only a subset of Betza notation can be used. However, since it works for knights, it could be expected that it should work for other pieces. As far as I have tested, besides the knight, none of the others work. So could this be implemented/fixed? Thanks!

ianfab commented 2 years ago

This is a result of rider moves being implemented via magic bitboards, see https://github.com/ianfab/Fairy-Stockfish/blob/master/src/bitboard.cpp. Implementing other riders is possible, but it creates overhead for memory and speed, and of course needs to be implemented and maintained. Considering that they are rather rarely used, adding them does not have a high priority.

DSARichard commented 2 years ago

I see. Thanks for letting me know. :)