Computer Chess Club Archives


Search

Terms

Messages

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

Author: Gian-Carlo Pascutto

Date: 09:46:29 09/29/03

Go up one level in this thread


On September 29, 2003 at 12:42:24, Edward Seid 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
>
>A couple of questions:
>1 - should it read alpha > beta or alpha >= beta?

alpha >= beta, see my self-correction

>2 - some pseudocode examples initialize score = NEGATIVEINFINITY before
>generating the moves.  I haven't done this in my code.  Is it necessary?

In the current version it is not needed. You need to set score to -inf
only if you return score instead of alpha at the end, which you don't do.

--
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.