- 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.
4 simple questions
-
- Posts: 1242
- Joined: Thu Jun 10, 2010 2:13 am
- Real Name: Bob Hyatt (Robert M. Hyatt)
- Location: University of Alabama at Birmingham
- Contact:
Re: 4 simple questions
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.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.
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...