/js-ai-minimax-tic-tac-toe

A JavaScript tic-tac-toe game app that uses the minimax ai algorithm.

Primary LanguageJavaScript

js-ai-minimax-tic-tac-toe

AI Minimax Tic-Tac-Toe is a JavaScript game that allows a human to play an AI Minimax Algorithm.

The Minimax AI strategy recursively generates a tree of all possible outcomes from the current state of the game. Each alternative branch of the tree is assigned a score based on who ultimately wins. The AI then makes a move with the best score.

Minimax is able to anticipate the opponent's moves by assuming all players will make moves in their best interest.

The code uses the p5 libraries for the custom interface. Much of the concepts and code are derived from Daniel Shiffman’s video on Minimax AI.