python-ataxx: A Python library for the board game Ataxx
About
python-ataxx is written in Python 3 and supports basic features such as move generation, move validation, engine communication, and board printing. The API and rules for the game are still subject to change, be careful when updating.
Tests
Run the following command from the root project directory
python -m unittest discover
Usage
>>> import ataxx
>>> board = ataxx.Board()
>>> board.makemove(ataxx.Move.from_san("g2"))
>>> board.makemove(ataxx.Move.from_san("a7a5"))
>>> board.get_fen()
'6o/7/o6/7/7/6x/o5x x 1 2'
Features
- Printing the board
>>> board = ataxx.Board()
>>> print(board)
a b c d e f g
╔═╦═╦═╦═╦═╦═╦═╗
7║X║ ║ ║ ║ ║ ║O║7
╠═╬═╬═╬═╬═╬═╬═╣
6║ ║ ║ ║ ║ ║ ║ ║6
╠═╬═╬═╬═╬═╬═╬═╣
5║ ║ ║ ║ ║ ║ ║ ║5
╠═╬═╬═╬═╬═╬═╬═╣
4║ ║ ║ ║ ║ ║ ║ ║4
╠═╬═╬═╬═╬═╬═╬═╣
3║ ║ ║ ║ ║ ║ ║ ║3
╠═╬═╬═╬═╬═╬═╬═╣
2║ ║ ║ ║ ║ ║ ║ ║2
╠═╬═╬═╬═╬═╬═╬═╣
1║O║ ║ ║ ║ ║ ║X║1
╚═╩═╩═╩═╩═╩═╩═╝
a b c d e f g
Turn: X
- FEN parsing
>>> board = ataxx.Board("startpos")
>>> board = ataxx.Board("x5o/7/2-1-2/7/2-1-2/7/o5x x 0 1")
- Result detection
>>> board.gameover()
True
>>> board.fifty_move_draw()
False
>>> board.max_length_draw()
False
- Communication with UAI compatible engines
>>> import ataxx.uai
>>> engine = ataxx.uai.Engine("tiktaxx")
>>> engine.uai()
>>> engine.isready()
>>> engine.name
'Tiktaxx'
>>> board = ataxx.Board()
>>> engine.position(board)
>>> bestmove, ponder = engine.go(movetime=1000)
>>> engine.go(movetime=1000)
('a7b5', None)
>>> engine.quit()
- Simple players
>>> import ataxx.players
>>> board = ataxx.Board()
>>> move = ataxx.players.greedy(board)
>>> print(move)
f2
- PGN writing
>>> import ataxx.pgn
>>> board = ataxx.Board()
>>> board.makemove(ataxx.Move.from_san("a7c5"))
>>> board.makemove(ataxx.Move.from_san("b2"))
>>> game = ataxx.pgn.Game()
>>> game.from_board(board)
>>> print(game)
[Event "Example"]
[Result "*"]
1. a7c5 b2 *
Metadata
Release files for ataxx 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ataxx-2.2.0.tar.gz | 22.7 kB | Without provenance | Details for ataxx-2.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ataxx-2.2.0-py3-none-any.whl | Python 3 | none | any | Details for ataxx-2.2.0-py3-none-any.whl |
Total release size: 37.8 kB
Release files / ataxx-2.2.0.tar.gz
| Download URL | ataxx-2.2.0.tar.gz |
|---|---|
| Size | 22.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61b30b32172fee8292b895c0f6f1247d63280377d42bb7fcf5ad7a3cda1ebb41
|
|
BLAKE2b-256 checksum How to use checksums |
630a3217240d56171992a01bcadc5e371f3a04b252ddfad97363cbe95ec430fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|
Release files / ataxx-2.2.0-py3-none-any.whl
| Download URL | ataxx-2.2.0-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08bb9322774a677fd49b38a3ce6e0fcfa1af0592e19083b795604f64170cf0cb
|
|
BLAKE2b-256 checksum How to use checksums |
0bb0b4f46ade153fd20abf10e8f84a2bc589a0ffbf5611083085710e208bc195
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|
Security for ataxx 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.