This project is a web-based implementation of the classic Tic Tac Toe game, featuring 3x3, 4x4, and 5x5 versions. The game includes an intelligent AI opponent using the minimax algorithm with alpha-beta pruning.
- Three different board sizes:
- 3x3: Classic game with traditional rules
- 4x4: Advanced version requiring 4 in a row
- 5x5: Expert mode with enhanced winning conditions
- Intelligent AI opponent using minimax algorithm
- Responsive design for all screen sizes
- Modern user interface with animations
- Game state tracking
- Real-time win detection
- Easy reset functionality
- Light and Dark modes synchronysied with your system theme (New)
- Clone the repository:
git clone https://github.com/nur-srijan/tictactoe-web.git- Navigate to the project directory:
cd tictactoe-web- Open
index.htmlin your web browser or use a local server:
python -m http.server 8000Then visit http://localhost:8000/index.html
- Classic rules: get three in a row to win
- First player is X, AI is O
- Get four in a row to win
- Increased complexity with larger board
- Get four in a row to win
- Strategic gameplay with more winning possibilities
- Pure JavaScript implementation
- Minimax algorithm with alpha-beta pruning for AI
- Responsive CSS Grid layout
- Modern ES6+ features
- No external dependencies
- Chrome (recommended)
- Firefox
- Safari
- Edge
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT licence - see the LICENSE file for details.
- Font: Cooper Black and Press Start 2P from Google Fonts
- Inspiration: Classic Tic Tac Toe game
- AI Implementation: Minimax algorithm with alpha-beta pruning