Skip to content

OmiShrestha/py-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

py-Tac-Toe Game

This is a graphical Tic-Tac-Toe game implemented in Python using the tkinter library. It offers an interactive way to play the game, either against an AI.

Features

  • Interactive GUI: A user-friendly graphical interface for playing Tic-Tac-Toe.
  • AI Opponent: Play against a simple AI with basic logic for making moves.
  • Two-Player Mode: Option to play with a friend on the same device.
  • Win, Loss, and Tie Detection: Automatically checks for game outcomes after each move.
  • Score Tracking: Keeps track of scores for both players (Player X and Player O).
  • Reset Options: Buttons to reset the game board or reset the scores.
  • Responsive Design: The game window is centered and visually appealing.

How to Run

  1. Ensure you have Python installed on your system.
  2. Run the following command in your terminal:
    python3 tictactoe.py
  3. A graphical window will open where you can select the game mode and play the game.

How to Play

  1. At the start, choose whether to play against an AI or a second player.
  2. The game starts with Player X.
  3. Click on an empty cell to make your move.
  4. The game alternates between Player X and Player O.
  5. The first player to align three of their marks in a row, column, or diagonal wins.
  6. If all cells are filled without a winner, the game ends in a tie.

Resetting the Game

  • Reset Game: Click the "Reset Game" button to clear the board and start a new game.
  • Reset Scores: Click the "Reset Scores" button to reset the scores for both players.

Requirements

  • Python 3.x
  • tkinter (comes pre-installed with Python on most systems)

About

A graphical Tic-Tac-Toe game implemented in Python using the tkinter library.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published