🌟 A classic Tic-Tac-Toe game implemented in Rust with an unbeatable AI opponent using the minimax algorithm!
- 🚀 Features
- 🛠️ Installation
- 🎮 How to Play
- 📜 Game Rules
- 🤖 About the AI
- 📄 License
- 🤝 Contributing
- 🤖 Unbeatable AI: Uses minimax algorithm for optimal moves
- 🖥️ Console Interface: Simple and intuitive command-line interface
- ✅ Input Validation: Ensures valid moves only
- 🏆 Win/Draw Detection: Automatically detects game outcomes
- 🔄 Replay Option: Play again without restarting
- 📥 Install Rust: Ensure you have Rust installed
- 📂 Clone Repository:
git clone https://github.com/your-repo/tictactoe.git - 🛠️ Build Project: Run
cargo buildto compile - 🎮 Start Game: Run
cargo runto begin - 🔧 Development Mode: Use
cargo watch -x runfor live reloading
- 🟦 Game Board: 3x3 grid with positions labeled 0-2
- ❌ Player: You play as 'X'
- ⭕ Computer: AI opponent plays as 'O'
- ⌨️ Input: Enter row (0-2) then column (0-2) when prompted
- 🏁 Goal: Get three of your marks in a row (horizontal, vertical, or diagonal)
- 🤔 Strategy: Try to force a draw against the unbeatable AI
- 🔄 Turns: Players alternate placing 'X' or 'O'
- 🏆 Win: First to get 3 in a row (any direction) wins
- 🤝 Draw: Full board with no winner results in tie
- ⛔ Rules:
- Only empty spaces can be marked
- Input must be valid coordinates (0-2)
- No overwriting existing marks
- 🧠 Algorithm: Minimax with alpha-beta pruning
- 🏆 Performance: Always makes optimal moves
- 🤝 Outcome: Unbeatable (but can be forced to draw)
- ⚡ Speed: Efficient decision making
- 🎲 Strategy: Considers all possible moves and outcomes
🤝 Contributions Welcome!
- 🐛 Issues: Report bugs or suggest features
- 🛠️ PRs: Submit pull requests for improvements
- 📝 Guidelines:
- Follow Rust coding standards
- Write clear commit messages
- Include tests for new features
- Update documentation accordingly
Enjoy the game! 🎉