Castling can be done only when there isn't any pieces in between the king along with the rook you may go. The king and rook simply cannot have moved Earlier. You can not castle if your king is in Test or if doing this would shift your king via or into a square in which he will be in check. Many thanks! We are glad this was practical.Store an array