-
Notifications
You must be signed in to change notification settings - Fork 2
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
two winners possible... #1
Comments
Quick fix may be to replace if (!squares[i]) { with if (!winner && !squares[i]) { on this line https:/deadcoder0904/tic-tac-toe-svelte/blob/master/src/Board.svelte#L16 |
Sorry, didn’t receive a notification for this. @streger You’re right. Never got that edge case. Can u tell me the steps to reproduce that? I can’t seem to replicate. Also, try maybe @philster’s solution. It might be right. What I think a simple solution might be is you can disable the button when someone wins first :) I won’t be changing the code now as u said it’s just a demo. It’s more about learning Svelte than getting the logic right for what it’s worth. Still appreciate u taking the time to think through the edge case 🙌 |
I know this is just a demo, but it doesn't hurt to have some logic to not allow input after "first win".
Check screens:
"First win"
"second win"
The text was updated successfully, but these errors were encountered: