Live data from Hacker News

Chess invariants

muratbuffalo.blogspot.com

31–40 of 67 posts

Re: Chess invariants

#32
post #26

Earlier quoted context omitted.

Did you mean putting your opponent in check? In chess, you are not allowed to put yourself in check.

You said “ That's a consequence of not being allowed to put yourself in check (by any means).” My point is that there are no other means.

I was replying to a comment quoting an official rule saying "no piece can be moved if that exposes or leaves its own king in check."

I was pointing out that that specific rule (read to mean that moving a piece pinned against a king is not allow) is not strictly necessary. Putting oneself in check is not allowed regardless of whether it's because you moved a piece that was pinned against your king or moved your king directly into the line of sight of an opponent's piece. These are the different "means."

As a sibling comment points out, "The only action you can ever take in chess is moving," so it's not particularly meaningful to say that the only way to put yourself in check is by moving.

Re: Chess invariants

#34
post #32

Earlier quoted context omitted.

You said “ That's a consequence of not being allowed to put yourself in check (by any means).” My point is that there are no other means.

I was replying to a comment quoting an official rule saying "no piece can be moved if that exposes or leaves its own king in check." I was pointing out that that specific rule (read to mean that moving a piece pinned against a king is not allow) is not strictly necessary. Putting oneself in check is not allowed regardless of whether it's because you moved a piece that was pinned against your king or moved your king d…

And likewise, it's not particularly meaningful to say "That's a consequence of not being allowed to put yourself in check (by any means)."

The rule, "3.9.2: no piece can be moved if that exposes or leaves its own king in check." covers both the case of moving a pinned piece as well as moving the king into check, i.e. it covers all "means" of putting yourself into check.

Re: Chess invariants

#37
This is just the beginning. You could create more and more advanced invariants. And I am sure that this could be a way to "solve" chess, i.e., prove that it's a draw with perfect play.

Re: Chess invariants

#38
post #16

side question, which CS class(es) teach about invariants?

The well-known algorithms book Cormen et al. describes a lot of algorithms using loop invariants. I must say I never really liked this approach but I admit it makes things easier to reason about.

Re: Chess invariants

#39

Earlier quoted context omitted.

Well, if a piece is pinned it's illegal to move it. Rule 3.9.2: No piece can be moved that will either expose the king of the same colour to check or leave that king in check.

The point is that, logically, the first part of that rule (“expose the king”) is implied by the second part (“leave that king”), so the first part is redundant. You could simplify the rule to: No piece can be moved that will leave the king of the same color in check.

[deleted]

Re: Chess invariants

#40

Earlier quoted context omitted.

Well, if a piece is pinned it's illegal to move it. Rule 3.9.2: No piece can be moved that will either expose the king of the same colour to check or leave that king in check.

The point is that, logically, the first part of that rule (“expose the king”) is implied by the second part (“leave that king”), so the first part is redundant. You could simplify the rule to: No piece can be moved that will leave the king of the same color in check.

Pedantically I disagree, to leave something in a condition it must have been in that condition in the first place. We could have a game where you're allowed to place your king in check, but if it is in check at the start of your turn you must fix that.

While we're being pedantic though it's not a property of the piece that might be able to be moved that will place the king in check. It's a property of the move. For example we might imagine you have a rook between an enemy rook and your king. You can move the rook along the line between the enemy rook and the king, but not perpendicular to it.

The rule should be:

No move can be made where the moving players king is in check in the resulting position

Post reply on HN