/X-O-Demo

Primary LanguagePython

X-O Game

This is a simple X-O (Tic-Tac-Toe) game implemented in Python using the Tkinter library. The game allows two players, 'X' and 'O', to take turns and compete against each other. The winner is determined by forming a line of three of their symbols either horizontally, vertically, or diagonally on the 3x3 game grid.

Features

  • Two-player mode: 'X' and 'O' take turns to play the game.
  • Random starting player: The game randomly selects the starting player for each new game.
  • Dynamic turn indicator: The player's turn is displayed dynamically at the top of the window.
  • Restart button: You can restart the game at any time with the "Restart" button.
  • Score tracking: The wins for 'X' and 'O' are displayed at the bottom of the window.

How to Play

  1. Run the script to launch the game window.
  2. Players take turns clicking on the empty cells to place their symbols ('X' or 'O').
  3. The game automatically checks for a winner or a tie after each move.
  4. Click the "Restart" button to start a new game.

Rules

  • To win, a player must have three of their symbols in a row (horizontally, vertically, or diagonally).
  • If there are no more empty cells and no winner, the game ends in a tie.

Feel free to explore and enjoy this simple X-O game!

Screenshot 2024-01-06 125956 Screenshot 2024-01-06 130027 Screenshot 2024-01-06 130140