Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: boundschecking

Author: Tom Likens

Date: 07:28:20 11/04/02

Go up one level in this thread


On November 04, 2002 at 04:32:20, Severi Salminen wrote:

>>I can see randomize when I click F1 only as a visual basic command and I work in
>>C.
>>
>>I tried srand(0) before filling the array but it does not help and
>>zobrist[0][0][0] is different in debug mode and in release mode.
>
>Are you sure? I think rand() should return the exact same values if you use the
>same seed (srand()). Are you sure you run srand(0) and fill the table only once
>in both versions? There seems to be a bug somewhere.
>
>Severi

About 5 years ago I got tired of my program producing different
results when run on different architectures due to the various
implementations of the random number generators.  So instead of
creating the random numbers on the fly I wrote a program to
produce the zobrist values and stored them in a file that is
read once upon initialization.

The nice thing about this is that you can go crazy, if you like,
ensuring that these numbers have all the nice properties that
random numbers should have (i.e. hamming distance etc.).  The
really nice thing is that now the random values are predictable
no matter which machine or operating system or compiler your
engine is run under (of course whenever the hash table is
involved *nothing* is predictable, but that's another story).

regards,
--tom



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.