Skip to content

Conversation

@roryheim
Copy link

@roryheim roryheim commented May 7, 2019

I believe the goboard_slow.py from chapter 3 has an error in checking for ko violation. The original code ends up only comparing player and the object id; the object id will always be different, so even when the new board is returned to the state that will violate ko, it won't be detected. The Zobrist code works fine because the hashes are directly compared. So this is minor because most people will want to use Zobrist anyway.

I added a test to the provided test code to prove this bug exists. Try the test against the old code, it should fail.

Arguably I should write a dunder eq for this fix, but I went with this approach first.

@macfergus
Copy link
Collaborator

Good catch, thank you for this fix! Will review this tomorrow

@roryheim
Copy link
Author

roryheim commented May 7, 2019 via email

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

Successfully merging this pull request may close these issues.

2 participants