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

Projects
None yet
1 participant
@aprescott
Owner

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 some commits May 17, 2016

Detect seki and "clear" false eyes as non-territory points.
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.
Stop double-updating the stats for example controls.
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.
Avoid maintaining a list of points to check when calculating regions.
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 force-pushed the seki-detection branch from bbb2605 to ebb7ce8 May 17, 2016

@aprescott aprescott merged commit c92799d into master May 17, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@aprescott aprescott deleted the seki-detection branch May 17, 2016

@aprescott

This comment has been minimized.

Owner

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