~learn.
0:00 / 1:31
LLD · Chess

The bishop can see d3. It still can't go there.

transcript

Every rule of the bishop says d3 is fine. It's still illegal. And the classic design can't tell why.

White king on e1. White bishop on e2, right above it. Bishop to d3 is a perfect diagonal. Geometry says yes. But a black rook sits on e8. Same file. Move the bishop, and the rook hits the king. It's pinned.

The usual first design: every piece checks its own moves. But a bishop can't see the rook behind it. Or castling history, or en passant. So split the question. The piece says where it could go. The game says whether it's allowed.

For each candidate, the game plays it on the real board. Then asks one question: is my king attacked now? Take it back. Attacked? Drop it. That's the pin, handled. Safe? Keep it. For two humans, it's instant.

And that same check gives you the ending. No legal moves, and in check? Checkmate. No legal moves, not in check? Stalemate. A draw.

How do you prove it's right? Count every legal sequence. From the start: 20, then 400. Then 8,902. The published count. One rules bug changes it.

Pieces know geometry. The game decides legality. Play it, check the king, take it back.

Full breakdown in the lecture.