Correct calculation

When calculating matches for a king in chess, you determine which other players can move against your king? Or do you think that their whole? If you say this first, then a contradiction arises, like "this statement is false." Consider this image with two kings per square and their knights protecting from rooks. If we assume that the determination of possible moves should impede verification based on the possible actions of the enemy, then the logic alternates recursively.

  • Firstly, we say that our king is under control from an enemy knight, therefore we are limited in promoting our own knight, because we must escape.
  • Then we understand that the knight does not have free play on our royal square, because he will keep his king in control with our boat. In the end, we do not have our king.
  • Then we understand that we can’t verify that now we can move our own knight to the enemy king, forcing him to move from the check and prevent his further choice.
  • However, we notice that we cannot do this, because it will put us under control with the enemy rook.
  • We understand that since we cannot actually move our knight, the enemy king is not actually checked, so he can freely use his knight to attack our king.
  • Go to step 2 (no matter how many times you already have).

, , , . , . , ? , , , , .

Both in check, or neither?

: , , , ( , ), . . , , - (), . , , . ( "" ) , , , , . , - . , . .

, , , , . , , , . , , . , , . , . . . , . , , :

  • .
  • , .

-, , 2 1. , . , , . 1 , . , . , , . , : 2 1 . - . - . , , . , . . . . , . , , - , , . , , - . , , . , . . , , → → , . , → → . , , ? → , ? → - .

,

  • " ".
  • , , , , .
  • , .
  • , , . (, )

, , , , , . , 2, . ", , ( ), ". , , , .

icedtrees - , :

if for every move for player X (ignoring rules about king threats), 
player Y can capture player X king next turn, 
then player X is in checkmate.

:

{X is checkmate}
if and only if {
    For all legal moves:(move according to rule definition) X {
       There exists a generic move:(legal move A ignoring rules of protecting king A) Y such that {
          X king is captured
       }
    }
}
+3
3

, , , , , , . , , .

, , . , , , , .

, , .

:

Checkmate , , , .

, :

  • , , , , . , - , " ", . , , , .

:

X ( ), Y X , X .

" ":

, X : X- Y, . , .

:

  • (),
  • .
+4

, : -)

, :

  • - . -, , , , . , , .
  • , , , .
  • , , , , .
  • , . .
+1

My naive approach is likely to be this.

player.startTurn();
if (player.isInCheck()
    if(player.king.hasNoLegalMoves() && player.cannotProtectKing())
        game.checkMate(player);

function isInCheck() {
    boolean isInCheck = false;
    for (Piece p : player.Opponent)
        if (p.canAttack(player.king) {
            isInCheck = true;
            return;
        }

Maybe something is missing for me, but I do not understand why it would not be so simple.

0
source

All Articles