Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic Tac Toe GUI Game

Play Tic Tac Toe against a computer opponent with a visual interface built in Tkinter.


Overview

This project provides a GUI-based Tic Tac Toe game using Python's Tkinter. You can play against a basic AI opponent that tries to win or block your moves. The game keeps track of the scoreboard including wins, losses and draws and highlights winning cells.


Features

  • Interactive 3x3 grid interface using Tkinter
  • Play against a computer opponent
  • Tracks and updates scoreboard for Player, Opponent and Draws
  • Highlights winning cells
  • Restart button to reset the game at any time
  • Easy-to-read and modular code with separate classes for gameplay, grid UI and opponent logic

Getting Started

  1. Clone the repository
git clone https://github.com/yourusername/tic-tac-toe-gui.git
cd tic-tac-toe-gui
  1. Install dependencies
pip install -r requirements.txt
  1. Run the game
python main.py

The game window will open, allowing you to play against the computer. Scores will update automatically and winning cells are highlighted.


Dependencies

  • Python 3.10+
  • Tkinter (usually included with Python)

Optional: No external packages are required as Tkinter is standard with Python.


Notes

  • The AI opponent uses a simple strategy: tries to win first, blocks the player, then picks the first available cell.
  • Highlighted cells turn green when a player or the opponent wins.
  • Restart button clears the board but keeps the scores.
  • All game logic is separated into gameplay.py, grid.py and opponent.py for easy maintenance and extension.

License

This project is licensed under the MIT License.

About

Play Tic Tac Toe against a computer opponent with a visual interface built in Tkinter.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages