3

I read somewhere that to optimize move generation for a chess engine it's good to have fast detection of position where one side is checked (to eliminate illegal moves).

The author suggested that check detection could be improved slightly by having the code test for common checks which happen first. However, they didn't give anymore insight than that.

I reasoned that my code for check detection should look for checks coming from the opponent's side of the board. Other than that though I couldn't think of anything else. This lead me to ask the following question:

What are the most common checks which occur in chess?

For example, are checks from queens more likely than checks from knights? Are certain diagonals more prone to checks than files?

Advice for methods I could use to answer this question in the comments would also be appreciated

  • Download a batch of PGNs that you think will be representative, write code that looks for "+" or "#", extract the move and the FEN before the move, store them as pair. Or if you do not care about the position, find a way to obtain the placement of the checking piece fore the check and store that as a move (for example "Bd3-h7") – B.Swan Jul 29 at 13:37
2

What are the most common checks which occur in chess?

Back rank checks (and check mates) must be the number one. I would suspect that bishop checks from h2/h7 on the castled king should also be up there in the top 10 if not number two.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.