An open API service indexing awesome lists of open source software.

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

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