r/Python • • Sep 27 '21

Tutorial Using Minimax Algorithm to create an Unbeatable Tic-Tac-Toe Opponent in Python

https://youtu.be/EZA0v-jOsEk
17 Upvotes

6 comments sorted by

5

u/oh__boy Sep 27 '21

It would be more interesting for a more difficult game, it is very easy for humans play optimal tic tac toe. Connect 4 could be a good step up in complexity.

3

u/[deleted] Sep 28 '21

I'll give it a shot for my next project!

3

u/NuclearOops Sep 28 '21

Tic Tac Toe is a completed game, meaning you can usually predict the outcome in the first few moves. You probably don't need a particularly advanced system to make an unbeatable bot for that game.

1

u/[deleted] Sep 28 '21

Yep, hence the usage of the Minimax algorithm

0

u/NuclearOops Sep 28 '21

Ah I'm unfamiliar with it.

3

u/maffearth Sep 27 '21

I'm an unbeatable tic tac toe opponent.

Did python make me?