This is a command-line Tic-Tac-Toe game implemented in Python. It supports both Player vs. Player and Player vs. AI modes. The AI is powered by the Minimax algorithm, allowing it to make optimal moves.
- Play against another player or challenge the AI.
- AI uses Minimax for optimal move selection.
- Dynamic board printing for an interactive gameplay experience.
- Detects win conditions (rows, columns, diagonals) and draws.
- Custom player names and symbols.
This project runs on Python 3.x and does not require external dependencies.
git clone https://github.com/your-repository/tic-tac-toe.git
cd tic-tac-toepython tic_tac_toe.py- Select game mode:
- (1) Player vs. Player
- (2) Player vs. Computer
- Enter player names and symbols (optional).
- Take turns placing marks on the board.
- Win by getting 3 in a row, column, or diagonal.
- If the board is full with no winner, it's a draw.
- The Minimax algorithm evaluates all possible moves and selects the best one.
- AI assigns +10 for a win, -10 for a loss, and 0 for a draw.
- The depth factor helps the AI prioritize faster victories and avoid delays.
- The AI will always try to win or block a player's winning move.
Player 0 (X) vs. Player 1 (O)
X | | O
-----------
| X |
-----------
O | | X
Player 0 is the winner!
- Add a GUI using Tkinter or Pygame.
- Implement an Alpha-Beta pruning optimization for Minimax.
- Extend board size (e.g., 4x4 or 5x5 support).
This project is open-source and available under the MIT License.
Developed by NikTsiop