Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: a question about redesigning my alphabeta

Author: Russell Reagan

Date: 14:40:06 03/13/04

Go up one level in this thread


On March 13, 2004 at 17:32:49, Uri Blass wrote:

>I think that you do not understand my idea
>
>I suggest to do exactly the same things in the same order but to check for
>repetition or hash cut off before calling search and not after calling search.

Is this what you are wanting to do? Let's say the search normally looks like
this:

int AlphaBeta(int depth, int alpha, int beta)
{
    if (depth == 0)
        return Evaluate();

    TryRepetition();     // <--------
    TryHashTable();      // <--------
    TryNullMove();       // <--------

    GenerateLegalMoves();
    while (MovesLeft()) {
        MakeNextMove();
        val = -AlphaBeta(depth - 1, -beta, -alpha);
        UnmakeMove();
        if (val >= beta)
            return beta;
        if (val > alpha)
            alpha = val;
    }
    return alpha;
}

You are wanting to do this?

int AlphaBeta(int depth, int alpha, int beta)
{
    if (depth == 0)
        return Evaluate();

    GenerateLegalMoves();
    while (MovesLeft()) {
        MakeNextMove();

        TryRepetition();     // <--------
        TryHashTable();      // <--------
        TryNullMove();       // <--------

        val = -AlphaBeta(depth - 1, -beta, -alpha);
        UnmakeMove();
        if (val >= beta)
            return beta;
        if (val > alpha)
            alpha = val;
    }
    return alpha;
}

Basically to avoid the extra function call?



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.