alexobviously / bishop

A chess logic package for Dart with flexible variant support
https://pub.dev/packages/bishop
Other
19 stars 8 forks source link

Bug for castling in chess960 #72

Closed malaschitz closed 8 months ago

malaschitz commented 10 months ago

On line 436 in game.dart is a bug.

For example when in chess960 will be rook on a1 and king on c1, this condition gives incorrect result, because rook is moved from a1 to d1 and c1 is not empty.

I suggest this correction for condition:

if (board[midSq].isNotEmpty && midFile != royalFile) {

alexobviously commented 10 months ago

Okay I'll take a look this weekend. The castling stuff is always a bit tricky, so I'll test your suggestion and make sure it works with all the other cases. Btw if you gave me a full fen string for this it would be helpful, for clarity.

alexobviously commented 8 months ago

Fixed in 1.4.1, thanks!