guillemalomar / PythonChess

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

Do not allow some movements #42

Open guillemalomar opened 5 years ago

guillemalomar commented 5 years ago

Never allow a movement that would imply letting an enemy piece target your king. Also, when in a check, only allow a movement that will avoid a next turn check.

guillemalomar commented 5 years ago

Added a condition to not allow a king to move to a position where it would get checked.

Now it also lacks to forbid a piece to move if it's the only piece between an enemy and the king (so it would be a check). But that's harder to do.