A modern, responsive web-based implementation of the classic Tic-Tac-Toe game with multiple play modes.
-
Multiple Game Modes
- Play against another person
- Play against computer AI with smart move detection
-
Responsive Design
- Optimized for mobile and desktop
- Adjusts to different screen sizes and orientations
-
Interactive UI
- Animated transitions and effects
- Clear game status indicators
- Winning patterns highlighted
-
Smart Computer AI
- Attempts to win when possible
- Blocks player's winning moves
- Strategic position selection
-
Visit the landing page and select a game mode:
- "Play vs User" - Play against another person
- "Play vs Computer" - Play against computer AI
-
Game Rules:
- Players take turns marking X or O on the 3×3 grid
- First player to align three of their symbols horizontally, vertically, or diagonally wins
- If all cells are filled without a winner, the game ends in a draw
-
Controls:
- Click on an empty cell to place your mark
- Use the "New Game" button to restart at any time
- HTML5
- CSS3
- JavaScript (vanilla)
- Bootstrap 5.3.3
- Bootstrap Icons 1.11.3
-
Clone the repository:
git clone https://github.com/SadeepaNHerath/Tic-Tac-Toe.git
-
Open
index.html
in any modern web browser.
No build process or dependencies required!
index.html
- Landing page with game mode selectionvsPerson.html
- Player vs. player game interfacevsComputer.html
- Player vs. computer game interfacevsPersonApp.js
- Logic for player vs. player modevsComputerApp.js
- Logic for player vs. computer mode with AIstyle.css
- Styling for the entire applicationimg/
- Contains image assets
Developed by Sadeepa N Herath
© 2025 Sadeepa N Herath. All rights reserved.