Skip to main content

Creatively build Tic-Tac-Toe matches and store their data in a database of all users.

Project description

tictactoetools

tictactoetools is a Python package that provides functionality for building games of Tic-Tac-Toe with customizable features and storing the data of matches in a database.

Installation

To install the tictactoetools package, you can use the following command:

pip install tictactoetools

Usage

Builtin Functions

The package includes several built-in functions that facilitate the gameplay and interaction with the Tic-Tac-Toe game. These functions provide functionality for playing matches, creating new matches, prompting user input, managing player moves, and handling rematch options. There are also builtin functions for working with the database (see "Database")

The builtin play() function is an example of how all the functions can work together to make a Tic-Tac-Toe game, as well as logging data on the database.

Database

The tictactoetools package includes several built-in functions that facilitate working with the database, such as logging matches, retrieving player IDs, checking username existence, creating new users, and fetching player and match statistics.

The database for this package consists of the following tables:

Table: players

  • player_id: Unique identifier for each player.
  • username: The username of the player.

Table: matches

  • match_id: Unique identifier for each match.
  • player1_id: The ID of the first player in the match.
  • player2_id: The ID of the second player in the match.
  • start_time: The start time of the match.
  • end_time: The end time of the match.
  • board: The game board data for the match.
  • winner_id: The ID of the player who won the match.

Board Class

The Board class represents the internal Tic Tac Toe game board. It provides functionality to manage and display the board state, check for a winner, mark cells with player symbols, and perform other board-related operations.

Match Class

The Match class is a data class responsible for storing information about the players, start and end times of a match, the board configuration, and the winner.

Contributing

Contributions to the tictactoetools package are welcome! If you encounter any issues or have suggestions for improvements, please create an issue on the GitHub repository.

License

This package is licensed under the MIT License. See the LICENSE file for more information.

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

tictactoetools-2.1.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

tictactoetools-2.1.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file tictactoetools-2.1.1.tar.gz.

File metadata

  • Download URL: tictactoetools-2.1.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for tictactoetools-2.1.1.tar.gz
Algorithm Hash digest
SHA256 f534ae9eb6043b31210ab480009ee22cb327221b4ee72a8bcdf895feee46e33d
MD5 640078f285af55262bd77909408817a6
BLAKE2b-256 500908ae7e94925ea4f923349646fcf1f2f8fa0039e28219c0508754b948f40d

See more details on using hashes here.

File details

Details for the file tictactoetools-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: tictactoetools-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for tictactoetools-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dee311eebaad31d272224e66286270acabb9b04c661adfd6429ea82b468b6d4b
MD5 a3074fb1516208b5ffc28865fa20b508
BLAKE2b-256 3c52ce8cfb85cd53d312e9c118f242282567009dc2524fc99799c04ccdcf90c8

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