Castling can be done only when there aren't any pieces involving the king as well as rook you can transfer. The king and rook can not have moved Earlier. You can not castle In case your king is in Check out or if doing so would go your king as a result of or to your square where he would be in check. Thanks! We are happy this was practical.The matc