Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Limit extensions

Author: Stuart Cracraft

Date: 11:33:06 07/06/04

Go up one level in this thread


On July 06, 2004 at 12:44:03, Daniel Shawul wrote:

>On July 06, 2004 at 12:30:48, Jeff GAZET wrote:
>
>>Hi,
>>
>>i'm not sure about the way to limit extensions into the search tree.
>>I think some code will be easier to understand than my english. Example :
>>
>>search(int depth,int alpha,int beta...)
>>{
>>int base_extended=0, extended;
>>
>>if(InCheck(side)) {depth++; base_extended+=ONEPLY;}
>>
>>foreach(move)
>>   {
>>   extended=0;
>>
>>   if(is_pawnn_push_7(move)) {depth++; extended+=ONEPLY;}
>>   if(is_recapture(move)) {depth++; extended+=ONEPLY;}
>>
>>   if(extended>ONEPLY) {extended=ONEPLY;}
>>   if(base_extended+extended>TWOPLY) {extended=0;}
>>
>>   domove()
>>   score=-search(...);
>>   undomove()
>>
>>   if(extended) {depth-=extended;}
>>   }
>>}
>>
>>Is that right ?
>>
>>Regards.
>
>why do you increase depth and extended simultaneously?
>i think the following code works
>
>
>search(int depth,int alpha,int beta...)
>{
>int base_extended=0, extended;
>
>if(InCheck(side)) {base_extended+=ONEPLY;}
>
>foreach(move)
>   {
>   extended=base_extended;
>
>   if(is_pawnn_push_7(move)) {extended+=ONEPLY;}
>   if(is_recapture(move)) {extended+=ONEPLY;}
>
>
>   if(extended>ONEPLY) {extended=ONEPLY;} //this is enough
>
>   domove()
>   score=-search(depth + extended - ONEPLY,-beta,-alpha,...);
>   undomove()
>
>   }
>}
>

If we are going this route (instead of fractional), use if-else!

foreach(move) {
  if (pawn7th) depth+=1;
  else if (recapture) depth+=1;
  else if (checking) depth+=1;
  else ...
}
makemove
score=-search(...,depth-1,...)
unmakemove

Stuart



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.