Welcome to ZTicTacToe’s Documentation¶
Tic Tac Toe is a famous game in which two players take turns placing a mark on a 3x3 grid. The first player to get three in a row wins.
The module is a standalone implementation of the game TicTacToe providing functionality to keep track of the game’s state and to make moves.
Features¶
Standalone implementation of the game Tic Tac Toe.
Provides a way to customise move triggers and access state variables.
Comes with an engine with near perfect moves.
Written in Python from scratch and does not require any external libraries.
Can be integrated into a larger project, with very little effort.
Throws custom-built errors making it easy to debug and handle errors.
Links¶
Installation¶
pip install zttt
- Module zttt
PvP
PvC
ZTBaseBoard
ZTBaseBoard.set_indicators()
ZTBaseBoard.board_list
ZTBaseBoard.status
ZTBaseBoard.move
ZTBaseBoard.turn
ZTBaseBoard.winner
ZTBaseBoard.history
ZTBaseBoard.empty_positions
ZTBaseBoard.empty_corners
ZTBaseBoard.empty_edges
ZTBaseBoard.highlighted
ZTBaseBoard.board
ZTBaseBoard.on_move
ZTBaseBoard.on_finish
- Module zttt.zt_errors
ZTError
ZTBadFunctionCall
ZTGameException
ZTInvalidInput
- Examples