https://github.com/charan12-git/coding-samurai-internship-task-2
https://github.com/charan12-git/coding-samurai-internship-task-2
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/charan12-git/coding-samurai-internship-task-2
- Owner: charan12-git
- Created: 2025-09-23T13:13:44.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-09-23T13:20:53.000Z (10 months ago)
- Last Synced: 2025-09-23T15:21:29.794Z (10 months ago)
- Language: Python
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CODING-SAMURAI-INTERNSHIP-TASK-2
# 🎮 Tic-Tac-Toe AI (Minimax Algorithm)
A simple console-based **Tic-Tac-Toe** game in Python where you play against an **AI opponent** powered by the **Minimax algorithm with alpha-beta pruning**.
The AI can play optimally (unbeatable) or in an easier mode (random mistakes).
---
## ✨ Features
- Play as **X** (first) or **O** (second).
- AI opponent using **Minimax with alpha-beta pruning**.
- Two difficulty levels:
- **Optimal**: AI plays perfectly (cannot be beaten).
- **Easy**: AI sometimes makes random moves, making it beatable.
- Clean console-based UI with numbered grid positions.
- Replay option after each game.
---
## 🚀 How to Run
### 1. Clone the repository and Run the file
```bash
git clone https://github.com/your-username/tic-tac-toe-ai.git
cd tic-tac-toe-ai.
python tictactoe.py