I made an unbeatable Tic Tac Toe AI (Minimax algorithm)
https://www.youtube.com/watc...This video shows how I made my tic tac toe algorithm in Python. I used the minimax algorithm with alpha beta pruning to search through all possible game states and find the best move for the computer to make. The game can still end in a draw, but it should be impossible to win against it.
Minimax is a recursive algorithm -- it calls itself thousands of times for each turn the computer takes. This is a similar process to how basic chess AI's are created.
I keep calling it an AI (artificial intelligence) but I think technically it's just an algorithm.