Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: % of first move beta fails question.

Author: Michel Langeveld

Date: 05:42:50 03/09/04

Go up one level in this thread


On March 09, 2004 at 08:38:09, Michel Langeveld wrote:

>On March 09, 2004 at 05:22:45, macaroni wrote:

My code snippet sent you maybe into a forest. Here is an example from
Bruce Morelands homepage: http://www.seanet.com/~brucemo/topics/alphabeta.htm

int AlphaBeta(int depth, int alpha, int beta)
{
    int legal;

    if (depth == 0)
        return Evaluate();

    GenerateLegalMoves();

    legal = 0;

    while (MovesLeft())
    {
        MakeNextMove();
        val = -AlphaBeta(depth - 1, -beta, -alpha);
        if (isLegal()) legal++
        UnmakeMove();

        if (val >= beta) {
            betacounter++;
            if (legal == 1) beta1stcounter++;
            return beta;
        }

        if (val > alpha)
            alpha = val;

    }

    return alpha;
}


and then at the end of the search process:

beta1stcounter / betacounter * 100

Cheers,

Michel



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.