Author: Robert Hyatt
Date: 06:21:57 04/24/00
Go up one level in this thread
On April 24, 2000 at 00:14:05, Tom Kerrigan wrote:
>On April 23, 2000 at 23:40:32, Robert Hyatt wrote:
>
>>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.
>
>I have several data structures that use ply as an index, so starting at ply=1
>would be an annoying waste of memory. Probably minor, but it would still annoy
>me. What I was thinking, though, is only keeping the first_move[] array instead
>of only last_move[]. Then the loop can look like:
>
>for (i = first_move[ply]; i < first_move[ply + 1]; ++i)
> ...
>
>-Tom
That works. I do ply=1...N for sanity's sake. I didn't want to deal with ply
= 0...N-1, and have to deal with depth in that context, etc...
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.