Tic-Tac-Toe vs AI

Your turn.Marks placed0/0

Difficulty Can Wait

Lower settings deliberately mix in random moves, so use them to practice spotting missed blocks and unfinished threats. Strong AI chooses an optimal move every turn; against it, holding the draw is the expected result, not a sign that you are stuck. Choose the level by what you want to test.

Different training goals when playing tic-tac-toe as X or O against AI

Playing X or O

As X, take an immediate win first, answer any forced threat, then look for a double threat. As O, the opening reply matters more: meet a center opening with a corner and a corner opening with the center. If X makes no mistake, holding the draw as O is the right result.

X has the first moveO must answer accuratelyHold the draw
Comparing candidate squares with a hint and undo in a tic-tac-toe AI game

Different Move, Same Result

The hint returns one minimax-optimal square, but several moves may have the same score. If it differs from your choice, undo and play both lines from the same position. They are equivalent if they reach the same result. If one draws and the other loses, follow the forced replies until the outcomes split. A hint gives you a move to test, not the reason behind it.

Equivalent movesMinimax searchFollow forced replies
Replaying a tic-tac-toe AI game move by move to find the first mistake

Look One Move Earlier

By the time the final winning square is left open, the game is often already lost. Replay from the move where you passed up a win, missed a forced block, or allowed a double threat. Find the first position that changed from drawable to lost, then start again from there. That is the move worth fixing.

First losing moveMove-by-move replayReplay from the mistake

100%Beginner opponent random-move rate

42%Gentle practice random-move rate

12%Advanced practice random-move rate

0%Strong AI random-move rate