Skip to content

This is a simple game of Tic-Tac-Toe that you can play against the computer. The computer uses a minimax algorithm to determine the best move.

Notifications You must be signed in to change notification settings

dakshesh14/tic-tac-toe

Repository files navigation

Tic-Tac-Toe Game

They say nothing is impossible, but defeating a computer in a game of Tic-Tac-Toe is pretty close. This is a simple game of Tic-Tac-Toe that you can play against the computer. The computer uses a minimax algorithm to determine the best move.

I used the following technologies to build this game:

  • React
  • Tailwind CSS
  • TypeScript
  • Vite

What is minimax?

Minimax is a decision rule used in artificial intelligence, decision theory, game theory, statistics and philosophy for minimizing the possible loss for a worst case (maximum loss) scenario. When dealing with gains, it is referred to as "maximin"—to maximize the minimum gain. Originally formulated for two-player zero-sum game theory, covering both the cases where players take alternate moves and those where they make simultaneous moves, it has also been extended to more complex games and to general decision-making in the presence of uncertainty.

How does it work?

The computer uses a minimax algorithm to determine the best move. The computer always compute all the possible moves and chose the best one. The best move is the one that leads to a win or a draw.

Some resources that might help you understand the minimax algorithm:

About

This is a simple game of Tic-Tac-Toe that you can play against the computer. The computer uses a minimax algorithm to determine the best move.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published