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

Ko not detected if old board position is viewed #307

Closed
herzbube opened this issue Jan 18, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@herzbube
Copy link
Owner

commented Jan 18, 2017

  1. Start a new human vs. human game with simple ko rule
  2. Black plays A1
  3. White plays A2
  4. Black plays B2
  5. White passes
  6. Black plays C1
  7. White plays B1 and captures black A1.
  8. Black playing on A1 would be illegal, but black does not do that. Instead Black plays E5, or anywhere else on the board that is not related to the ko situation.
  9. Go back one board position
  10. Black plays A1

Expected: The move is declared illegal because of ko.
Actual: The move is not declared illegal, ko is not detected and the user is allowed to play. The move is then rejected by Fuego, resulting in the dreaded alert message "Your move was rejected by Fuego. The reason given was: illegal move: 7 B A1 (simple) . This is almost certainly a bug in Little Go. Would you like to report this incident now so that we can fix the bug?"

Note that the problem can also occur with superko rules.

@herzbube herzbube added this to the 1.3.1 milestone Jan 18, 2017

@herzbube herzbube self-assigned this Jan 18, 2017

@herzbube herzbube closed this in e302a5c Jan 19, 2017

@herzbube

This comment has been minimized.

Copy link
Owner Author

commented Jan 22, 2017

This diagram illustrates the problem:

[...] -----41-----42-----43-----44-----45
                         ^             ^
                         |             +--- the game has 45 moves
                         +--- user views the old position after move 43
                              and attempts to make a new move here

In the situation depicted by the diagram, the ko detection logic must ignore moves 44 and 45 and instead base its decision on the moves up until move 43. The bug was that the ko detection logic did not do that, it based its decision on all the moves ever played in this game, including moves 44 and 45.

In more technical terms, the ko detection logic was using the lastMove property of the current GoGame, which does not return the move for the current board position, but the overall last move that the user ever made during this game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.