Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Chess programming: hash table.

Author: Robert Hyatt

Date: 12:58:22 01/09/01

Go up one level in this thread


On January 09, 2001 at 13:56:04, Normand M. Blais wrote:

>Hi,
>
>I'm having problem with the hash table in my program. I'm getting confused with
>the meaning of draft vs depth remaining. Let me show you what I do and maybe
>some one can tell me if I'm doing something wrong.
>
>// global variables
>int ply;
>int max_depth;
>
>
>void iterf(){
>    ply=0;
>    for(int i=1; i<=max_iteration_depth; i++) {
>        max_depth = i;
>        int score = negamax(...i);
>    }
>}
>
>void negamax(....depth) {
>    hashrec *h;
>
>    int draft = max_depth-ply;

I don't follow that.  The best way to do this is to initialize "depth" to
N where N is the iteration number you are searching.  Each time you call
Search() (or negamax in your case) recursively, you call it with "depth-1".

That is what you store as "draft" when you poke something into the hash
table, and that is what you use to compare to the hash table entry draft
when you probe...



>
>    probe_hashtabel(h);
>
>    if (draft <= h->depth) {
>    // hash hit
>    }
>
>    movegen(ply);
>
>    for (int i=0; i<move_list_len; i++) {
>        int val = negamax(....depth-1);
>
>        // if fail high
>        store_hash(.....depth);
>    }
>}
>
>Thanks,
>
>Normand Blais



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.