4 simple questions

Code, algorithms, languages, construction...
Post Reply
geko
Posts: 34
Joined: Mon Aug 01, 2011 5:11 pm

4 simple questions

Post by geko » Tue Oct 11, 2011 8:52 pm

- 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.

hyatt
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

Post by hyatt » Wed Oct 12, 2011 12:44 am

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...

Post Reply