Fix a bug that allowed castling even if squares were attacked #3
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "castling-through-check"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -69,3 +67,3 @@
)
func (k King) movedOnValidCastlingSquare(b *Board, move types.Move) (bool, CastlingDirection) {
func (k King) isCastlingAllowed(b *Board, move types.Move) (bool, CastlingDirection) {
This function is just ugly.
It checks a lot of things. The code for the black and white branches are almost the same. This should be done in multiple steps in a more systematic fashion.