Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: move lists

Author: Tom Kerrigan

Date: 17:00:27 04/23/00

Go up one level in this thread


On April 23, 2000 at 19:35:06, John Coffey wrote:

>I assume that at least some programs generate a complete move list at every
>branch of the tree.  That is my intent at the moment.  (My 1987 program was
>kind of dumb in that it only cared about move order at the base of the tree, so
>it always generated moves on the fly above the base without keeping a list.)
>
>So I see myself having a big array of moves.  When I generate moves deeper than
>the base, I will add them to the array and keep track of where the beginning and
>end are for the current depth.
>
>Does anyone else do it this way?  Is this a valid approach?
>
>John Coffey

Yes, it's extremely valid. Here's what I do:

move_t move_heap[];
int first_move[], last_move[];

So to loop through all the moves for a given ply, this is what I do:

for (i = first_move[ply]; i < last_move[ply]; ++i) {
  // the move to examine is move_heap[i]
}

-Tom



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.