+ 1
Why isnt it working properly?
https://code.sololearn.com/WoX3srjj7XUZ/?ref=app and how to let the computer play automatically with the user?
4 Respostas
+ 3
You shouldn't have multiple tags using the same id as you have no control over which one gets selected by the lookup.
+ 2
I've fixed it a bit.
https://code.sololearn.com/Ww5FIe44K3J2
+ 1
You need code to prevent hitting the same button twice or hitting a button the computer picked. You need code to check for a winner. To start, just randomly pick a unused button and get the other items needed working. Once you got most stuff working, add this:
https://medium.freecodecamp.org/how-to-make-your-tic-tac-toe-game-unbeatable-by-using-the-minimax-algorithm-9d690bad4b37
+ 1
thanks