Hey all,

  I was thinking about our conversation and i decided to design a zobrist
class that allows for easy comparison to check and see if 2 different
zobrist values are equivalent after a rotation etc...  It updates the
zobrist in such a way that it can transform them and after trying 8
possiblilities, it can determine if they are equal.  There are actually
quite a few optimizations that could be performed on it, but I just wanted
to post the basic idea.   See the following source code for the basic idea:

http://www.nicholasapperson.com/computergo/zobrist.h

Essentially it works so that it hashes the played stone as each of the
rotated forms and stores that in each of the 8 bytes used.  The bytes are
arranged in an order such that flipping the 2 DWORDs results in the zobrist
value for if there was a rotation in the x axis, flipping WORDs results in a
reflection across the y axis and swapping bytes results in a reflection
across the y=x line.  Order obviously matters in the case of xy so the
transformation is assumed to take place after the other reflections.  For
example:

if we have 0x1234567890ABCDEF as a zobrist value,

0x90ABCDEF12345678 would be the zobrist of the position with a reflection
across the x-axis


Anyway, I'm sure there is a bug or two, but I wanted to get your alls
thoughts.

- Nick
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to