Bitboard CHESS ENGINE in C: generating CASTLING MOVES

Hey what’s up guys, Code Monkey King’s here. In this video we gonna be generating castling moves for both kings bearing in mind that castling is available if appropriate castle bit is set up (king didn’t move or rooks didn’t move), when there are now pieces in between king & rooks and neither king nor nearby squares it’s stepping through to castle are not under attack of the opposite side.



  1. 16:34 Not sure why we don't discard casting to g1 by checking if that square is attacked. Does it make a difference if we check for it here rather than when making the move? It feels weird to have it displayed as a possible move when it is not legal.

  2. Since it is a little bit surprising that you do not check attacks on the castling king's target square you could explain that in a comment line and not only in the video.

Leave a Reply

Your email address will not be published.