Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Principal variation search question.

Author: Daniel Shawul

Date: 02:29:49 05/10/05

Go up one level in this thread


On May 10, 2005 at 05:15:28, Kevin K wrote:

>On May 10, 2005 at 04:36:30, Renze Steenhuisen wrote:
>
>>What kind of sick yoke is this? It is the same code...
>>
>>The second code even contains the line "fFoundPv = TRUE;" A variable that isn't
>>even declared!
>>
>>Well... If you really didn't see, and you asked seriously:
>>
>>fFoundPv is TRUE when "this is the first move"
>>
>>Cheers
>>
>>Renze
>
>It was typo.
>I mean:
>
>int AlphaBeta(int depth, int alpha, int beta)
>{
>    if (depth == 0)
>        return Evaluate();
>    GenerateLegalMoves();
>    while (MovesLeft()) {
>        MakeNextMove();
>        if (this is the first move)
>            val = -AlphaBeta(depth - 1, -beta, -alpha);
>        else {
>            val = -AlphaBeta(depth - 1, -alpha - 1, -alpha);
>            if ((val > alpha) && (val < beta)) // Check for failure.
>                val = -AlphaBeta(depth - 1, -beta, -alpha);
>        }
>        UnmakeMove();
>        if (val >= beta)
>            return beta;
>        if (val > alpha)
>            alpha = val;
>    }
>    return alpha;
>}

Most of the time they do the same job as 80% of the time
the best move that causes a cut of is the first.
It seems logical for me to wait until you found a PV move before
applying null windows rather than starting it after first move is searched.
daniel



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.