GithubHelp home page GithubHelp logo

x-o-demo's Introduction

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

x-o-demo's People

Contributors

mhmodfrmwi avatar

Stargazers

ahmed zakaria avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.