You all must have played Tic-Tac-Toe game at some point of your life. Whether on the back of the notebook with your friend, in the mobile or with the bot on Google.
Let me introduce you to Tic-Tac-Toe Vanish which is a simple but exciting take on the existing classic game. Here, the rules change and the excitement increases.
If you have played the game with the bot on Google, you might know that it has three different modes: Easy, Medium & Impossible.
Have you ever thought how these modes work. Let me explain, In the easy mode the bot plays randomly and the Human always wins. In the medium mode, the bot just try to stop the player from making the winning line, but if the player somehow makes two simultaneous win position then the player will win.
But in the Impossible mode it is not possible for the player to make any such situation and whatever move the player plays either it will be a tie or a win for the bot.
In the impossible mode it uses the MinMax Algorithm which finds the best possible move for the bot assuming the opponent player also plays optimally.
How does the algorithm works:
For better understanding and actual implementation of algorithm, you can watch this YouTube Video.
In Tic-Tac-Toe Vanish, there’s a twist that changes everything: After every three total moves, the oldest move disappears from the board.
So, the marks don't stay forever. As the players take turns the game continuously evolves. So, there will be not TIE game and every game will have a definite result.
To make the game more fun (and challenging), I included three difficulty levels as the classic one:
Also, in the vanish mode there is a possibility of the Player's win against the Bot at every level. Even using the MinMax Algorithm for Hard level it have some edge cases where the Bot can be defeated.
I used Next.js along with Tailwind CSS and Framer-Motion for the development of the game. Also, the game is hosted on Vercel.
Try out the game: Tic-Tac-Toe-Vanish
If you find any bug or want to contribute in the game: GitHub Repo
If you find the edge cases where you win. Please reach me out.