Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Where should i Get started...

Author: Dann Corbit

Date: 23:17:04 07/12/02

Go up one level in this thread


On July 13, 2002 at 01:50:49, Russell Reagan wrote:

>Let me see if I understand what you are saying. TSCP it uses a move stack rather
>than a move list? So the following would be an example of a program that uses a
>move list (off the top of my head here...)
>
>int AlphaBeta(int depth, int alpha, int beta)
>{
>    if (depth == 0)
>        return Evaluate();
>
>    vector<Move> moves;
>    int val;
>    GenerateLegalMoves(moves); // fills moves with the legal moves
>
>    for(int i = 0; i < moves.size(); i++)
>    {
>        MakeMove(moves[i]);
>        val = -AlphaBeta(depth-1, -beta, -alpha);
>        UndoMove();
>        if (val >= beta)
>            return beta;
>        if (val > alpha)
>            alpha = val;
>    }
>    return alpha;
>}
>
>With any coding errors I made (I think you get the idea), is that what you meant
>by a program that uses a move list?
>
>If that is correct, then is using a move list rather than a move stack
>considered better or worse? Or is it simply a matter of simplicity or personal
>taste?

A move list gives back its money for construction in evaluate().

If you know what the pieces are and where they are sitting, you can avoid a lot
of branching and testing.



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.