Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Crafty question (move storage area)

Author: Robert Hyatt

Date: 10:48:08 12/17/01

Go up one level in this thread


On December 17, 2001 at 11:42:58, Alvaro Jose Povoa Cardoso wrote:

> in
>  struct tree [
>     ...
>     int *last[MAXPLY]; ???
>     ...
>  }
>
>  It seems to me that this a list of pointers.
>

Correct...


>
> ----------------------------------------------------------
>|                                                          |
>|   initialize.                                            |
>|                                                          |
> ----------------------------------------------------------
>*/
>  if (ply >= MAXPLY-1) return(beta);
>  tree->nodes_searched++;
>  next_time_check--;
>  tree->last[ply]=tree->last[ply-1]; ???

last[ply-1] is a pointer that is one _beyond_ the last move in the
move list for ply-1.  I start off the current ply at that value and
then the move generator will increment this value as it produces moves
and stuffs them into the move list.





>  o_alpha=alpha;
>
>
>
> Also the following loop is used to loop thourgh all the moves.
>    for (movep=tree->last[ply-1];movep<tree->last[ply];movep++) {
>     .
>     .
>     .
>    }
>  Again I don't see from where the moves come from, although it seems that you
>have some memory allocated somewhere and you use these pointers to index the
>first and the last move from each ply.
>
>
>  Could you please explain where do you store the generated moves?
>  I really don't see where they get stored as they are generated.


Look at movgen.c...  it is passed "last[ply]" as a parameter.  It increments
this as it generates moves and stuffs them into the move list.  This list of
pointers points into a large array used to hold the moves for each ply...






>
>Best regards,
>Alvaro Cardoso



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.