Skip to content

OmerRaifler/Unbeatable-TicTacToe

Repository files navigation

Unbeatable-TicTacToe

This is an unbeatable(!) version Tic-Tac-Toe that I created for Android devices using Java.

The idea behind the unbeatable bot

Essentially, in Tic-Tac-Toe, if your opponent makes zero mistakes throughout the whole game, the game can end in either tie or in the opponent's win.

So how can we ensure that our opponent is bound to make zero mistakes? And, more specifically, how can we turn it all into code?

Well, using the recursive Minimax algorithm, we evaluate all the possible outcomes, and choose the optimal move accordingly.

You can read more about the implementation of Minimax in Tic-Tac-Toe here: https://www.neverstopbuilding.com/blog/minimax

About

With AI using Minimax algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages