guillemalomar / PythonChess

A work in progress of a Chess game for PvP
GNU General Public License v3.0
1 stars 0 forks source link

Add castling #46

Open guillemalomar opened 5 years ago

guillemalomar commented 5 years ago

Add this feature to the game movements (https://en.wikipedia.org/wiki/Castling)

guillemalomar commented 5 years ago

"Castling consists of moving the king two squares towards a rook on the player's first rank, then moving the rook to the square over which the king crossed. Castling may only be done if the king has never moved, the rook involved has never moved, the squares between the king and the rook involved are unoccupied, the king is not in check, and the king does not cross over or end on a square in which it would be in check."

guillemalomar commented 5 years ago

So, if we move the king and castling conditions are all correct it will allow, apart from allowing all typical movements, to move a tower to the next to the king in the opposite site.