Page 1 of 1

4 simple questions

Posted: Tue Oct 11, 2011 8:52 pm
by geko
- in the Quiescence procedure -
1) if there are no capture return evaluate_board ??
2) if the enemy king is captured return INFINITE ??

- In the search procedure -
3) if there are no moves return -INFINITE ??
4) if the enemy king is captured return INFINITE ??

thank you
g.

Re: 4 simple questions

Posted: Wed Oct 12, 2011 12:44 am
by hyatt
geko wrote:- in the Quiescence procedure -
1) if there are no capture return evaluate_board ??
2) if the enemy king is captured return INFINITE ??

- In the search procedure -
3) if there are no moves return -INFINITE ??
4) if the enemy king is captured return INFINITE ??

thank you
g.
Close. for (1) and (2), yes. For (3) no. You need to return something that says you are mated, but you have to indicate how far from the root you are. In this case, perhaps -infinite + ply, where "ply" is the number of the current ply. You have to be able to recognize shorter vs longer mates so that you don't draw a won position because you don't realize that a mate in 1 is much better than a mate in 10.

for (4) maybe. In a search that uses null-move, it is not advisable to advance to the next ply by playing an illegal move that leaves the king in check. Null-move might well fail high and lead you right into a loss...