A simple and interactive Tic-Tac-Toe game built in C++, featuring:
✔ 2-Player Local Mode ✔ AI Mode using Minimax Algorithm ✔ Clean console UI ✔ Input validation & error handling ✔ Organized & modular code
This project demonstrates fundamental programming concepts such as loops, conditions, game logic, decision-making, and basic AI.
Tic-Tac-Toe (Console)
==============================
- 2-player (Local)
- Play vs Computer (You are X)
- Play vs Computer (Computer starts as X)
- Exit
Choose (1-4):
| File | Description |
|---|---|
| tictactoe.cpp | Local 2-player mode |
| tictactoe_ai.cpp | AI mode using Minimax |
| output.txt | Saved console output preview |
| README.md | Project documentation |
Basic Version
g++ tictactoe.cpp -o tictactoe.exe -static-libstdc++ -static-libgcc ./tictactoe.exe
AI Version
g++ tictactoe_ai.cpp -o tictactoe_ai.exe -static-libstdc++ -static-libgcc ./tictactoe_ai.exe
🧠 AI opponent using Minimax
🎯 Error-free user input
🎨 Clean and readable console UI
🔁 Replay option
🧩 Best for learning C++ game development
Anshul Rajput Software Developer | C++,Python Developer & AI Enthusiast 👉 GitHub: https://github.com/anshull-rajput