Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hash codes

Author: Dann Corbit

Date: 17:55:36 11/13/01

Go up one level in this thread


On November 13, 2001 at 20:02:43, David Hanley wrote:

>I think we're on the same page.  I'm using the zorbist function in my program.
>I'm just trying to create better hash values than simply using the built-in
>random function by making sure that no two codes have fewer than eight bits
>different than any other code.  In C pseudocode, it's essentially:
>
>zorbist_keys
>
>make_zorbist_key()
>{
>  do
>     key = random( 1 power key_length );
>  while( key not_similar_to_any zorbist_keys );
>
>  add key to zorbist_keys;
>  return key;
>}
>
>It seems that by making sure each code has at least 8 bits different than any
>other, i should greatly reduce the incidence of hash collisions, especially if
>rand() is "funky."

It must have been that darn LISP stuff.  I never could figure out how you could
write a program consisting entirely of parenthesis and yet still somehow manage
a complete and correct program. ;-)

As for prng, the Mersenne Twister has some incredibly good properties as far as
randomness is concerned.

>I'll probably still bump the length up to 64, as you suggest.
>
>Thanks for your help!  That tutorial page seems pretty good.

I suspect that the book on chess programming (like the program Ferret) will
remain forever out of reach and I'll just pine away waiting.
;-)



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.