Tic Tac Toe with AI

A simple implementation of the classic Tic Tac Toe game in Python, featuring an AI opponent. The game uses the Tkinter library for the graphical user interface (GUI).

Features

  • Play against the computer: The AI acts as the second player and makes optimal moves to win the game.
  • User-friendly GUI: The game interface is built using Tkinter, providing a smooth and intuitive experience.
  • Restart functionality: During or after the game, players can easily restart a new round.

How to Play

  1. Clone the repository or download the source code.

  2. Make sure you have Python 3.x installed on your system.

  3. Run the game using the following command:

    python3 tic_tac_toe.py
  4. The game board will appear with an empty 3x3 grid.

  5. Click on the cells to place your moves. The AI will respond automatically.

  6. The game will continue until a player wins or the board is full (a draw).

  7. After the game concludes, click the "Restart" button to start a new round.

Dependencies

  • Python 3.x
  • Tkinter library (usually included with Python installations)