Avatar

Tic-Tac-Toe Vanish – Reinventing a Classic Game

Tic-Tac-Toe Vanish – Reinventing a Classic GameJune 19, 2025

Hi Everyone!

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.

Classical Tic-Tac-Toe

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.

  • The AI (Maximizer) tries to maximize the score.
  • The human (Minimizer) tries to minimize the score.

How does the algorithm works:

  • The algorithm explores all possible future moves (and their resulting boards), forming a tree of game states.
  • At the leaf nodes (end of games):
    • If the AI wins: +1
    • If the human wins: -1
    • If it's a draw: 0
  • From the leaf nodes, the algorithm propagates scores upward:
    • Maximizer (Bot) picks the move with the maximum score.
    • Minimizer (human) picks the move with the minimum score.

For better understanding and actual implementation of algorithm, you can watch this YouTube Video.

The Twist - Vanish Mode

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.

Bot Logic in Vanish Mode

To make the game more fun (and challenging), I included three difficulty levels as the classic one:

  • Easy: Random bot moves
  • Medium: Bot blocks player’s immediate win
  • Hard: A twist on the Minimax algorithm

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.

🚀 Play the Game Now!

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.

Built with Love by Deepak Bhatter