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

Connect 4 bug #37

Closed
guskal01 opened this issue Apr 24, 2020 · 2 comments
Closed

Connect 4 bug #37

guskal01 opened this issue Apr 24, 2020 · 2 comments

Comments

@guskal01
Copy link

There is a bug in the connect 4 game logic, but it's small enough that I'm sure it hasn't affected training. If a player (parity says it must be player 2) wins on the last move of the game (move 42), it will be rewarded as a draw.
From connect4.py: reward = 1 if done and 0 < len(self.legal_actions()) else 0
No legal actions doesn't mean someone didn't just win.

Example:

a = self.Game()
mv = [2,1,1,1,3,1,4,1,6,5,7,2,3,4,5,6,7,7,6,5,4,3,2,7,6,5,4,3,2,2,3,4,5,6,7,7,6,5,4,3,2,1]
for m in mv:
    x = a.step(m-1)[1:]
    print(x)
    a.render()

Last step prints (0, True) even though the second player won. https://connect4.gamesolver.org/?pos=211131416572345677654327654322345677654321

@guskal01
Copy link
Author

Same bug also present in tictactoe.

@werner-duvaud
Copy link
Owner

Thank you !

It should be good now.

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

2 participants