/tic-tac-toe

Unbeatable Tic Tac Toe with Minimax Algorithm

Primary LanguageJavaScript

A Unbeatable Tic Tac Toe Game with Minimax Algorithm

Project Description

Overview

The game is played on a 3*3 grid. You have to choose a sign between 'x' and 'o', and players(you and computer) take turns to mark empty squares. The first player to get 3 marks in a row(up, down, across or diagonally) is the winner. When all 9 squares are full, the game is over. When all 9 squares are full and no player achieve the 3 marks in a row, call it a tie game.

Technologies Used

  1. Minimax Algorithm It is a basic algorithm usually applied in zero-sum game theory. The key logic is to minimizing the possibility to lose. The algorithm generates a tree data structure, and recursion is used in the structure to get the best result.

  2. CSS animation

Showcase

front-page

in-the-game

For live version please check here