hgm wrote: ↑Sun Sep 19, 2021 12:01 pm
Rebel wrote: ↑Sat Sep 18, 2021 9:04 pm
hgm wrote: ↑Sat Sep 18, 2021 7:58 pm
What Ed descibes is detecting opportunities to capture a King with a sequence of 3 moves (of the same player). What you asked for is detecting opportunities to capture the King with a sequence of 2 moves.
Not exactly, in diagram 1 the black rook is already on a8 and in diagram 2 the white rook is already on e1. I posted it that way to emphasize it's about one move only, not all moves. It's a kind of fast static nullmove looking for checks.
It is not entirely clear to me at which time the move is judged. Is the following understanding correct?
* In the position of the diagram, you generate all moves, including Ra8.
* All these moves are made
* Then it is tested whether the moved piece could capture the King in two moves (the first possibly by discovering it).
For Ra8 this is the case (Ra8-a1, Ra1xg1). For other moves (or at least non-captures), you immediately return a fail low, effectively pruning it retro-actively. (Because the eval remains too much below alpha?)
* With the Rook on a8 you now generate and search all moves of white.
* After most of those you search at least Ra8.
[fen]r7/1R3pp1/4p1k1/3pP1Np/2pP4/2P5/5PPP/6K1 b - -[/fen]
As simple as possible.
1. In this position during search the move Kxg5 is already searched and thus alpha has a reliable value.
2. The move Rf8-a8 is evaluated (see diagram) and the eval score is way below alpha and we are trying to reduce the move or prune the tree depending on depth. We check if the move Ra8
might be dangerous and if that's true we don't reduce or prune. And one of the conditions is to detect if the move Ra8 may create a check.
3. A rook can go 4 directions, we try them all. We loop through direction -1, via a table look up conclude that Ra7 never can produce a check, same for squares a6,a5,a4,a3,a2. Arrived on a1 the table produces a true value and arrived here I call an existing routine (I suppose everybody has) that checks if the board situation (WKg1 <> BRa1) produces a check and if so the move Rf8-a8 isn't pruned or reduced while all other rook moves are pruned or reduced.
That's is.
Meanwhile I get new 403 Forbidden errors

90% of coding is debugging, the other 10% is writing bugs.