regex-chess icon indicating copy to clipboard operation
regex-chess copied to clipboard

Easy mate -- ignores direct attack with Queen?

Open oising opened this issue 1 year ago • 2 comments

c4, Qa4, Qxa5, Qc7, Qxc8#

oising avatar Jan 07 '25 17:01 oising

This is an expected behavior due to how I implement the 2-ply search. It's more of 1.75-ply search: the second ply is evaluated as part of the "is my current move putting me in check" which only computes pseudo-legal moves. This means

(1) the computer assumes the opponent can make pseudo-illegal moves in reply to their moves, which is bad, but less relevant to your specific issue, but also (2) the computer doesn't know when they're about to get mated on the next move because I don't do the extra "is checkmate" search in the legal move search; doing this would require another ~half ply of searching, which would make the engine considerably slower so I decided to omit this.

Leaving the issue open for now though because at some point I'd like to write an efficient "is checkmate" routine that could give me this more efficiently.

carlini avatar Jan 07 '25 17:01 carlini

I edited my sequence because I'd omitted a move in my haste (Qxa5). I implied an illegal move; the sequence is legal but the reality is that on move 3, it gives up the queen and then falls to mate later.

edit: btw, you're a lunatic. love it.

oising avatar Jan 07 '25 18:01 oising