๐ 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! ๐