A lightweight, browser-based Tic Tac Toe game built using pure HTML, CSS, and JavaScript. It features an AI opponent powered by the Minimax algorithm, offering both easy and hard difficulty modes, along with match tracking and a clean responsive UI.
Tic Tac Toe Bot is designed for learning, experimentation, and gameplay. It follows a modular development structure with a single-file distributable build for portability and a structured source setup for maintainability.
- Download
dist/tic-tac-toe-bot.html - Open it in any browser
- Start playing immediately
- Works offline
- No installation required
- Clone the repository
- Open:
src/index.html
- Edit files inside the
src/directory - Build the project when needed:
python scripts/build.py
Recommended for development, customization, and learning.
-
Classic 3×3 Tic Tac Toe gameplay
-
Player vs AI (X = user, O = AI)
-
Difficulty modes:
- Easy: random moves
- Hard: Minimax algorithm
-
Match progress tracking with progress indicators
-
Detects wins, draws, and ongoing states
-
Highlights winning combinations
-
Reset round or full match
-
Toggle difficulty dynamically
-
Sound effects for interactions
-
Fully offline and self-contained
tic-tac-toe-bot/
│
├── index.html # Entry / landing page
│
├── src/ # Development source code
│ ├── index.html
│ ├── script.js
│ └── style.css
│
├── dist/ # Final build (for users)
│ └── tic-tac-toe-bot.html # Single-file app
│
├── scripts/ # Build tools
│ └── build.py
│
├── README.md
├── LICENSE
└── .gitignore
Run:
python scripts/build.py
This will:
- Combine HTML, CSS, and JavaScript
- Bundle everything into a single file
- Output the final build into the
dist/directory
This project uses two modes:
- Modular structure inside
src/ - Easier debugging and editing
- Ideal for learning and extending logic (UI + AI)
- Single-file build inside
dist/ - Fully portable
- Offline-ready with no dependencies
- HTML5
- CSS3
- Vanilla JavaScript (DOM manipulation + Minimax AI)
- Python (build automation only)
- Not a perfect AI (Minimax is deterministic but still basic in this context)
- No multiplayer or online mode
- No persistent storage of match history
- Browser-dependent rendering differences may exist
- UI is intentionally minimal for clarity and learning
https://akpandey-dev.github.io/tic-tac-toe-bot
- Open for learning and experimentation
- Bugs may exist
- Improvements and suggestions are welcome
This project is open for learning, modification, and experimentation.