Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do we need zobrist hash code for None? #88

Open
fuhaoda opened this issue Apr 6, 2021 · 0 comments
Open

Why do we need zobrist hash code for None? #88

fuhaoda opened this issue Apr 6, 2021 · 0 comments

Comments

@fuhaoda
Copy link

fuhaoda commented Apr 6, 2021

Hi,
I noticed that from gobroad.py to gobroad_fast.py, when we add or remove a point, we add a new line to remove empty point hash code as below before applying a stone from a player

self._hash^= zobrist.HASH_CODE[point, None]

Is this really necessary since we already code the empty board as 0.
After trying only provide black and white stone zobrist hash code for each position, it seems work fine.

Also, in the book listing 3.20, we didn’t generate zobrist code for None as well.

Could you please confirm that adding hash code for None is not necessary? or did I miss something obvious?
Haoda

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant