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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tictactoetools-2.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dee311eebaad31d272224e66286270acabb9b04c661adfd6429ea82b468b6d4b |
|
MD5 | a3074fb1516208b5ffc28865fa20b508 |
|
BLAKE2b-256 | 3c52ce8cfb85cd53d312e9c118f242282567009dc2524fc99799c04ccdcf90c8 |