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.
-
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.
-
CSS animation
For live version please check here