Jogo da Velha
Lógica

Jogo da Velha

History

Tic-Tac-Toe is one of the world's oldest pastimes — 3×3 grid records have been found in Ancient Egypt and two-thousand-year-old Rome. Simple to learn but impossible to fully master, it teaches intuition, anticipation, and blocking logic from childhood. In this digital version, you face an Artificial Intelligence that plays perfectly on the highest level, making it impossible to beat — because in Hard mode, it never makes mistakes. The real challenge is forcing a draw and, on easier modes, exploiting windows of imperfection before the AI closes them.

Mechanics

The board is a 3×3 grid. You play as ✕ and always go first; the AI plays as ○. Each turn, tap or click any empty cell to place your mark. The goal is to form a line of three ✕ in a row — horizontal, vertical or diagonal — before the AI forms its line of three ○. If all 9 cells are filled with no winner, the game ends in a draw. There are three difficulty levels: Easy (the AI plays randomly, leaving many gaps), Medium (the AI mixes 40% random moves with 60% optimal moves — dangerous but exploitable) and Hard (the AI uses full Minimax and is mathematically unbeatable — the best possible result is a draw).

Challenges

On Hard mode, Tic-Tac-Toe reveals its mathematical depth: with perfect play from both sides, the result is always a draw. Beating the AI at this level is impossible — the challenge becomes forcing a draw without making mistakes. On Medium mode, the AI makes occasional mistakes, opening windows of opportunity. The challenge is recognizing and exploiting those gaps quickly, before the AI regains control. On Easy, the obstacle is internal: don't get complacent, and consistently close three in a row.

Tips to Win

  • 1The center (cell 5) is the most powerful position — whoever takes it controls 4 of the 8 possible lines.
  • 2Corners are the second-best positions. Occupying two opposite corners creates a fork trap.
  • 3If the AI takes the center, play a corner — this limits its forking options.
  • 4Create double threats (two pairs of ✕ at the same time): the AI can only block one, and you win with the other.
  • 5On Hard mode, accept a draw as a win — defeating a perfect Minimax is beyond possible.