Skip to main content

A Python implementation of the Tic-Tac-Toe game using Pygame.

Project description

Python PyPI License

tic-tac-toe-pygame

A Python implementation of the Tic-Tac-Toe game using Pygame.

Overview

This is a simple Tic-Tac-Toe game built with Pygame. The game allows two players to play against each other on a 3x3 grid. Players take turns placing their marks (X or O) in the empty cells of the grid until one player wins or the game ends in a draw. The game checks for winning conditions after each move and displays the result on the screen.

Features

  • Two-player mode.
  • Simple and intuitive interface.
  • Win detection and draw handling.
  • Pygame graphics.

Requirements

  • Python 3.10 or higher.
  • Pygame library.

Installation

To install the required dependencies, run:

pip install tic-tac-toe-pygame

Usage

To run the game, execute the following command in your terminal:

python -m tic_tac_toe_pygame

Game Rules

  • The game is played on a 3x3 grid.
  • Players take turns placing their marks (X or O) in the empty cells.
  • The first player to align three of their marks horizontally, vertically, or diagonally wins the game.
  • If all cells are filled and no player has three in a row, the game ends in a draw.

How to Play

  1. Start the game by running the command above.
  2. The game window will open displaying a 3x3 grid.
  3. Players take turns clicking on the empty cells to place their marks.
  4. The game will announce the winner or if the game ends in a draw.

Contributing

Contributions are welcome! If you have suggestions for improvements or new features, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tic_tac_toe_pygame-0.4.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tic_tac_toe_pygame-0.4.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file tic_tac_toe_pygame-0.4.0.tar.gz.

File metadata

  • Download URL: tic_tac_toe_pygame-0.4.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.2 Darwin/24.5.0

File hashes

Hashes for tic_tac_toe_pygame-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f52d913280a5377fb855b81b509ce808ce8ae28b78a47d0ec43dfd5ba9830946
MD5 9b7f752f1ed70b440bece45ceb295341
BLAKE2b-256 3bdd71d5de868544568d760cf42021ebdde4c4f019e8c32b3d1f1b09bba2f096

See more details on using hashes here.

File details

Details for the file tic_tac_toe_pygame-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: tic_tac_toe_pygame-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.2 Darwin/24.5.0

File hashes

Hashes for tic_tac_toe_pygame-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52d162aa9b9c4f48569de40df56f1e6efb12a9586a31f8ec20efaab83bcd83f1
MD5 a6a3a55c3ae9ff1f1a9d20c39cee8f5b
BLAKE2b-256 e9eaecce2bd20779da6d6bce3e6d19496b0c2e7553905d5ea5b2fc0c9071dd38

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page