this is two player game (You vs robot).
the robot in this game is using an algorithm called Minimax, which making it unbeatable player.
Minimax is a recursive algorithm which is used in decision-making and Game theory. It provides an optimal move for the player assuming that opponent is also playing optimally.
- In minmax algorithm two players play the game, one is called MAX and other is called MIN.
- Both the players fight it as the opponent player gets the minimum benefit while they get the maximum benefit.
- Both Players of the game are opponent of each other, where MAX will select the maximized value and MIN will select the minimized value.
- The minimax algorithm performs a depth-first search algorithm for the exploration of the complete game tree.
The minimax algorithm proceeds all the way down to the terminal node of the tree, then backtrack the tree as the recursion.
.
.
.
JavaTpoint: minimax algorithm in Artificial Intelligence
GeeksforGeeks: three parts on how to apply the algorithm in the tic-tac-toe game