[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HELP] Zobrist Hashing




The basic idea is simple.  Allocate an array of random numbers for black
and another for white board positions.   

Hash any position by Xoring all the random numbers associated with the 
occupied positions.  The hash for any position is *very* likely to be unique. 

So if you have 10 patterns, or 10,000, it takes the same amount of time 
to match a board position against the entire set of patterns; hash the
position, and use hte result as a probe in a hash table containing all
the patterns.  Obvious extensions of the basic idea handle symmetry, 
movable patterns, and so on.