Tic Tac Toe

A classic game of Tic Tac Toe with both two-player and AI modes. Players take turns placing their marks ("X" or "O") on a 3×3 grid, aiming to get three in a row horizontally, vertically, or diagonally.

Game Modes

Two Player

The classic two-player mode. First player uses "X", second player uses "O", taking turns to place their marks. Balance attack and defense while enjoying the competitive spirit with a friend.

VS Computer

Three AI difficulty levels available, from beginner to expert, suitable for players of all skill levels.

Easy Mode

AI makes random moves, perfect for learning the basics.

Medium Mode

AI uses basic strategy with simple attack and defense patterns.

Hard Mode

AI uses optimal strategy and is nearly unbeatable. Great for learning advanced tactics.

How to Play

1. Getting Started

Select a game mode and player X goes first. Click any empty cell to place your mark.

X

2. Winning the Game

Get three of your marks in a line to win. Valid lines can be:

X
X
X

Horizontal Line

X
X
X

Vertical Line

X
X
X

Diagonal Line

3. Draw

If all squares are filled without either player getting three in a row, the game ends in a tie.

Strategy Tips

• Control the center - It offers the most line opportunities

• Watch your defense - Block your opponent's potential winning moves

• Create fork moves - Set up multiple winning threats simultaneously

• Read your opponent - Anticipate and counter their strategies

FAQ

Q: What's different about each AI mode?

Easy AI moves randomly, Medium AI uses basic strategy, and Hard AI uses perfect strategy and never loses.

Q: Why do games often end in draws?

Tic Tac Toe often results in draws when both players use optimal strategy. This makes it excellent for learning strategic thinking.

Q: How can I improve my game?

Start with Easy AI and gradually increase difficulty. Study the AI's moves and learn from its strategies.

Q: Is going first an advantage?

The first player ("X") has a slight advantage as they can control the initial game flow. However, perfect play from both sides typically leads to a draw.

Q: Where should I place my first move?

The center square is the strongest opening move as it provides the most line opportunities. If taken, corner squares are the next best choice.

Q: Can I undo moves in two-player mode?

To maintain fairness and excitement, the game doesn't support undoing moves. This encourages careful decision-making and commitment.