Author: Robert Hyatt
Date: 20:40:32 04/23/00
Go up one level in this thread
On April 23, 2000 at 22:44:53, Tom Kerrigan wrote:
>On April 23, 2000 at 22:28:59, Flemming Rodler wrote:
>
>>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
>
>Having first_move is nice because you can't access last_move[-1] (for ply 0). Of
>course, you can avoid this problem if you're careful, but for now I'm taking the
>straightforward approach.
>
>-Tom
This isn't a problem if you start with ply=1 and not 0.
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.