Open guillemalomar opened 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.
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.