I think you'd have to first check to see if there are any possible moves your king can make... and then if the attacking piece is not a knight, you will probably have to check every other piece on the board to see if it can move anywhere inside the line of the attacking piece and the king. lastly, every piece should be tested to see if it can actually kill the attacking piece.
if the king cannot make a legal move, and the attacking piece is a knight, then the only possible scenario is a checkmate (unless the knight itself can be taken.) No block can occur.
When all three conditions occur; no legal move for king, no block can occur, and the attacking piece cannot be taken, only then can you conclude checkmate.
Clinton Portis
Practically a Posting Shark
833 posts since Oct 2005
Reputation Points: 237
Solved Threads: 118
What about the following scenario?
1) Your king is not in check.
2) It's your move and any move you make places your king into check.
Is that checkmate?
VernonDozier
Posting Expert
5,527 posts since Jan 2008
Reputation Points: 2,633
Solved Threads: 711