-
Notifications
You must be signed in to change notification settings - Fork 416
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
[tic tac toe], before implementing minimax #33
Comments
please assign me this issue |
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the user clicks on tiles "3,4,5" (they should win), the AI player plays too (this is wrt the code at the end of section 5) and chooses tile number "2". On tracing the path of the programme, we see that in the script, the 'turn' function is called which is meant to "checkWin" which will return "True" (as the human player has won). But, according to the way java execution works, simply returning from that function doesn't stop the execution of the next line of code in the parent function. Thus, even though we win, the only condition being checked before the AI player playing is if the game has been drawn, not won. This can be rectified easily by changing line 31 from
to
The text was updated successfully, but these errors were encountered: