jeromevonk/chess_console

Game::isUnderAttack does not test if the square is under attack from the king

Closed this issue · 2 comments

In some situations this will incorrectly not award a checkmate

You were absolutely right.

Function Game::isUnderAttack now_ checks if a square is under attack by the king, in every direction a king can attack.

There a test condition for this here.

I took me almost 5 years to look at this issue, but... better late than never :P