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

Detect seki and "clear" false eyes as non-territory points #11

Merged
merged 4 commits into from May 17, 2016

Conversation

@aprescott
Copy link
Owner

@aprescott aprescott commented May 17, 2016

This reorganizes quite a few things to shift responsibility around. It also changes the scoring API on a Game.

The seki detection algorithm follows these steps:

  1. Fill in all neutral points.
  2. Fill in all false-looking eyes which are points of immediate capture for any neighboring group in atari. (This is iterative until there are no more such points.)
  3. If a group can't make 2 eyes, it's seki and is ignored.

Neutral filling in step (1) follows an alternating grid pattern.

aprescott added 4 commits May 17, 2016
This reorganizes quite a few things to shift responsibility around. It
also changes the scoring API on a Game.

The seki detection algorithm follows these steps:

  1. Fill in all neutral points.
  2. Fill in all false-looking eyes which are points of immediate
     capture for any neighboring group in atari. (This is iterative
     until there are no more such points.)
  3. If a group can't make 2 eyes, it's seki and is ignored.

Neutral filling in step (1) follows an alternating grid pattern.
This gives a pretty big performance improvement for the examples because
now the seki calculation stuff isn't happening twice. The `postRender`
callback already does this work.
Checking `indexOf(i) < 0` is expensive. We only need to loop through the
intersections once for the outer loop. `checkedPoints` does it all.
@aprescott aprescott merged commit c92799d into master May 17, 2016
2 checks passed
@aprescott aprescott deleted the seki-detection branch May 17, 2016
@aprescott
Copy link
Owner Author

@aprescott aprescott commented May 18, 2016

I wrote up a post with more info on how this actually works: https://aprescott.com/posts/seki

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

Successfully merging this pull request may close these issues.

None yet

1 participant