Closed puspraj-india closed 5 years ago
Thanks for the suggestion. 95%+ of positions have a bishop, rook, or queen so I assume adding extra conditions would degrade performance:
Perhaps short-circuit evaluation might improve performance, for example:
(this.rooks ^ this.queens) & Bitboard.rookAttacks(king, 0)
EDIT: Technically, short-circuit evaluation doesn't work, but maybe there's a more complex way to make this work: https://stackoverflow.com/a/8759917
On my PC, the proposed change is a negative 20% speedup.
Flag of pin and skewer should be not checked if no bishops , no rooks and no Queen are present