Skip to content

Conversation

@Hardcode3
Copy link
Owner

@Hardcode3 Hardcode3 commented Jan 5, 2026

📌 Various fixes

📄 Description

  • Added missing bitwise exclusive or ^ & ^= operators for Bitboard objects (+tests)
  • generate_attacks now x-rays kings. It still does not x-ray other pieces. This change originates from a bug where the king could move away from the sliding piece checker. Now squares beyond the king are attacked and therefore are not available to move to.
  • Removed check mask argument for king legal moves generation function. This changes originates from a bug where the check mask was applied to filter the king moves, therefore constraining the moves to the ray between the sliding attacker and the king, discarding relevant escape moves.
  • Implemented a missing function (+tests) to determine real checkers based on board occupancy. The previous code introduced a bug since checkers was simply the intersection between the occupancy and the geometric attacks for a given square. Therefore it was finding much more checkers than possible.
  • Updated legal moves generation function to support the changes made in this PR (+tests).
  • Other print statements cleanup in the codebase

🧩 Type of Change

  • 🐛 Bug fix
  • ✨ New feature

@Hardcode3 Hardcode3 self-assigned this Jan 5, 2026
@Hardcode3 Hardcode3 added bug Something isn't working cleanup Cleaning any kind of stuff in the project to make it clearer. enhancement Improving the code base in any way. labels Jan 5, 2026
@Hardcode3 Hardcode3 marked this pull request as ready for review January 6, 2026 09:34
@Hardcode3 Hardcode3 merged commit 742eb6c into main Jan 6, 2026
5 checks passed
@Hardcode3 Hardcode3 deleted the various_fixes branch January 6, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cleanup Cleaning any kind of stuff in the project to make it clearer. enhancement Improving the code base in any way.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants