Need help with tic-tac-toe game in java | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Need help with tic-tac-toe game in java

This is what I have so far. Everything works, but it will not tell if anyone is a winner. It just keeps looping back to each player and once the board fills up, it asks to choose another number because no space is available. Also, my no space available output only works with player 1, not player 2. So, if player 1 chooses a spot that is taken, the program asks the player to choose another spot. When player 2 does the same thing, the program just asks player 2 to pick a spot, not the same prompt player 1 will get. Can someone help me figure out my mistakes?

12th Mar 2018, 9:28 PM
maddie nicole
5 Answers
0
i know...couldnt find the java button
13th Mar 2018, 6:45 PM
maddie nicole
0
thank you!!
13th Mar 2018, 8:50 PM
maddie nicole
- 1
the code should be here: https://code.sololearn.com/Wp1ql4f831Fx under JS
13th Mar 2018, 11:19 AM
maddie nicole
- 1
I've fixed some minor mistakes and it works quite fine! Huge problem is that SL doesn't 'wait' for the input, it will request all at once at the beginning, but that's not your problem. Nice code!
15th Mar 2018, 6:51 PM
D B
D B - avatar
15th Mar 2018, 6:53 PM
D B
D B - avatar