Skip to content
← Projects

Tic-Tac-Toe AI

Web-based Tic-Tac-Toe with an unbeatable AI opponent powered by the Minimax Algorithm with Alpha-Beta Pruning.

Built by

GitHub
HTMLCSSJavaScriptMinimaxAlpha-Beta Pruning

Overview

A web-based Tic-Tac-Toe game with an unbeatable AI opponent — powered by the Minimax algorithm with Alpha-Beta pruning. Play optimally and the best you can do is draw.

How It Works

  • Minimax explores the full game tree, scoring terminal states (win/lose/draw) and assuming both players play optimally
  • Alpha-Beta pruning cuts branches that can't affect the outcome, making the search far more efficient
  • The AI always picks the move that maximizes its guaranteed result — so it never loses

What I Built

  • A clean, responsive game board in vanilla HTML/CSS/JS
  • The full Minimax + Alpha-Beta decision engine
  • Win/draw detection and game-state management

Tech Stack

Frontend: HTML, CSS, JavaScript

Algorithm: Minimax with Alpha-Beta pruning

Why It Matters

A hands-on implementation of adversarial game-search — the same family of algorithms behind classic game AI — built from scratch and visibly unbeatable.

Related projects

Spiritual Browser Galaxy Theme Extension

A Chrome extension replacing the new tab with a spiritual, distraction-free galaxy experience — zero backend, zero tracking.

Indian Culture Website

A visually rich informational website celebrating Indian culture — art, traditions, festivals, cuisine, and regional heritage.

Spotify Clone

A pixel-accurate frontend clone of the Spotify web player — sidebar, album cards, playlist layout, and the bottom player bar.