We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c100a37 commit 08a815dCopy full SHA for 08a815d
1 file changed
chess/__init__.py
@@ -916,7 +916,7 @@ def king(self, color: Color) -> Optional[Square]:
916
considered.
917
"""
918
king_mask = self.occupied_co[color] & self.kings & ~self.promoted
919
- return msb(king_mask) if king_mask and popcount(self.kings) == 1 else None
+ return msb(king_mask) if king_mask and popcount(king_mask) == 1 else None
920
921
def attacks_mask(self, square: Square) -> Bitboard:
922
bb_square = BB_SQUARES[square]
0 commit comments