marcizhu / readme-chess

♟️ Play Multiplayer Chess in a README file!
https://github.com/marcizhu
MIT License
89 stars 14 forks source link

Game wouldn't end #5

Closed afanasy closed 2 years ago

afanasy commented 2 years ago

Black move, white king is attacked by the black queen, the game should end:

Screenshot 2022-07-15 at 16 21 15

https://github.com/import-brain

marcizhu commented 2 years ago

The white king is not attacked by black's queen. Black's queen is on D8, the starting square. The piece on H2 is a rook, so it is not giving check to white's king at all. Furthermore, the rook on H2 is not defended by any other black piece, so even if it were a queen, the white king could simply capture the queen.

It is not game over. Keep playing! And have fun 😄

marcizhu commented 2 years ago

Stockfish also thinks that this position is completely fine. I hope these icons clear out the doubt on which pieces are which:

image

And as I said, even if it were a queen, white's king could simply take (in fact that was the best move):

image
afanasy commented 2 years ago

Got confused by the shapes, thank you for the review @marcizhu!

marcizhu commented 2 years ago

No problem!! Glad to help 😄