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

Fix Multiple Winners in the Test #969

Open
SuperConfuserUser opened this issue Mar 5, 2018 · 1 comment
Open

Fix Multiple Winners in the Test #969

SuperConfuserUser opened this issue Mar 5, 2018 · 1 comment

Comments

@SuperConfuserUser
Copy link
Collaborator

Line 109-113 of the 04_game_spec asks that the won? method ''returns the correct winning combination in the case of a win''.

Board originally has two winners down the middle (Os) and the right side (Xs).
game.board.cells =
["X", "O", "X",
"O", "O", "X",
"O", "O", "X"]

Winning combos would be either [1,4,7] or [2,5,8]. So either could be returned as the winner depending on the order the combo. I had to move [2,5,8] ahead of [1,4,7] in WIN_COMBINATIONS definition to get it to pass.

It can be changed to game.board.cells =
["X", "O", "X",
"O", "O", "X",
" ", " ", "X"]

@hansenjl
Copy link
Collaborator

hansenjl commented Mar 6, 2018

This pull request: https://github.com/learn-co-curriculum/ttt-with-ai-project/pull/42/files would fix this issue. @cjbrock

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