Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Programmers: please check my alpha-beta algorithm

Author: Gian-Carlo Pascutto

Date: 09:35:01 09/29/03

Go up one level in this thread


On September 29, 2003 at 12:32:53, Patrick N wrote:

>On September 29, 2003 at 11:54:55, Gian-Carlo Pascutto wrote:
>
>>On September 29, 2003 at 11:49:20, Edward Seid wrote:
>>
>>>         score = -AlphaBeta(deep - 1, -beta, -alpha)
>>
>>[...]
>>
>>>         ' The following lines are what I need feedback on... are they correct?
>>>         If alpha >= beta Then
>>>            Return alpha
>>>         End If
>>>         If score > alpha Then
>>>            alpha = score
>>>         End If
>>
>>Reverse them.
>>
>>E.g.
>>
>>if score > alpha then alpha = score;
>>if alpha > beta then return alpha;
>>
>>--
>>GCP
>
>I agree with reversing them, but you also want the second line to read:
>if alpha > beta then return beta;
>
>This way if the score exceeds beta (fail high) you return beta
>-Patrick

No.

There is no need whatsoever to return beta there.

--
GCP



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.