All Projects
Tic Tac Toe preview
WebLive

Tic Tac Toe

Classic game with a smart AI opponent

Smart AI OpponentSmooth AnimationsScore TrackingResponsive Design
Visit Live Site

Problem

While there are countless Tic Tac Toe implementations online, most are either too basic with no AI opponent, or they lack polish in terms of animations and user experience. Many are built as quick tutorials without attention to responsive design, accessibility, or smooth interactions. There was an opportunity to build a polished, production-quality version that demonstrates modern frontend development practices while being genuinely fun to play.

Solution

This Tic Tac Toe game features an unbeatable AI opponent that looks ahead at every possible outcome before it moves. Every interaction is animated, from placing marks and highlighting the winning line to the confetti celebration and board resets. The responsive design works seamlessly on both desktop and mobile, with touch-friendly tap targets and visual feedback.

Key Features(10)

Choose X or O

Pick your symbol on the Choose Your Symbol screen, and the AI automatically takes the other one.

Unbeatable AI Opponent

The computer plays perfect moves by looking ahead at every possible outcome, so the best you can do is draw.

Natural AI Turns

X always moves first, so picking O lets the AI open, and the AI pauses briefly before each move so it feels natural.

Live Turn Indicator

A badge shows whose turn it is, and the active player's score card glows.

You vs AI Scoreboard

Score cards track wins for you and the AI across rounds, and the winner's card pulses after each victory.

Winning Line Highlight

The three winning cells turn green, and a draw outlines both score cards in yellow.

Challenges

The main challenge was making an AI that never loses while still feeling like a fair opponent. The minimax algorithm searches every possible future move to always find the best one, so the work went into the feel around it: a short pause before each AI move so it does not answer instantly, letting the AI open when the player picks O, and clear feedback for wins, draws and whose turn it is.

Learnings

This project was an excellent exercise in algorithm implementation within a modern React context. It demonstrated how game state can be cleanly managed with React hooks and how to structure code so that the AI logic is completely decoupled from the UI. The animation work with Framer Motion provided valuable experience in creating polished micro-interactions.