Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: move lists

Author: Flemming Rodler

Date: 19:28:59 04/23/00

Go up one level in this thread


On April 23, 2000 at 20:00:27, Tom Kerrigan wrote:

>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

Since you have that first_move[ply] = last_move[ply-1]+1 you don't need
first_move[]. Maybe it will even save you some time since you do not avoid a
lookup in first_move.

/Flemming



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.