Tic Tac Toe
Play Tic Tac Toe against a rule-based AI. First to get three in a row wins — simple, fast, and free.
How to Play Tic Tac Toe
- X always goes first. Click any empty square to place your mark.
- The first player to fill a whole row, column or diagonal with their mark wins: three in a row on the 3×3 board, four on 4×4, five on 5×5.
- If every square is filled with no winner the game is a draw. Changing the board size starts a new game.
- Click Reset to play again immediately.
Frequently Asked Questions
- Can two humans play on the same device?
- Yes — set both players to Human and take turns clicking squares.
- How smart is the CPU?
- The CPU uses a rule-based engine that always takes a winning move when available and always blocks an opponent's winning threat.
- Is there a first-mover advantage?
- With optimal play from both sides the game always ends in a draw. The CPU is designed to play optimally, so expect draws when both sides use AI.
- What strategies can the CPU use?
- Two, and both use the rule-based priority order — win, block, then take the centre, a corner, or an edge. Best always takes the first square the rule allows, so it plays the same way every time. Random picks at random among the squares the rule allows, so its games vary.
- Can the game be played on a bigger board?
- Yes — pick 4×4 or 5×5. The engine carries a separate rule list for each board size, so larger boards get their own priorities rather than reusing the 3×3 ones.
- How do I beat the CPU?
- Neither strategy ever misses a win or a block, so a single threat never works: you need two winning lines at once. On 3×3, expect most games to end in a draw.