ataxx


Nameataxx JSON
Version 2.2.0 PyPI version JSON
download
home_pagehttps://github.com/kz04px/python-ataxx
Summarypython-ataxx is written in Python 3 and supports basic features such as move generation, move validation, engine communication, and board printing.
upload_time2024-03-12 17:50:00
maintainer
docs_urlNone
author
requires_python
licenseMIT
keywords ataxx
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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
```Bash
python -m unittest discover
```

## Usage
```Python3
>>> 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
```Python3
>>> 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
```Python3
>>> board = ataxx.Board("startpos")
>>> board = ataxx.Board("x5o/7/2-1-2/7/2-1-2/7/o5x x 0 1")
```

* Result detection
```Python3
>>> board.gameover()
True
>>> board.fifty_move_draw()
False
>>> board.max_length_draw()
False
```

* Communication with UAI compatible engines
```Python3
>>> 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
```Python3
>>> import ataxx.players
>>> board = ataxx.Board()
>>> move = ataxx.players.greedy(board)
>>> print(move)
f2
```

* PGN writing
```Python3
>>> 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 *
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/kz04px/python-ataxx",
    "name": "ataxx",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "ataxx",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/63/0a/3217240d56171992a01bcadc5e371f3a04b252ddfad97363cbe95ec430fd/ataxx-2.2.0.tar.gz",
    "platform": null,
    "description": "# python-ataxx: A Python library for the board game Ataxx\n\n## About\npython-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.\n\n## Tests\nRun the following command from the root project directory\n```Bash\npython -m unittest discover\n```\n\n## Usage\n```Python3\n>>> import ataxx\n>>> board = ataxx.Board()\n>>> board.makemove(ataxx.Move.from_san(\"g2\"))\n>>> board.makemove(ataxx.Move.from_san(\"a7a5\"))\n>>> board.get_fen()\n'6o/7/o6/7/7/6x/o5x x 1 2'\n```\n\n## Features\n* Printing the board\n```Python3\n>>> board = ataxx.Board()\n>>> print(board)\n  a b c d e f g\n \u2554\u2550\u2566\u2550\u2566\u2550\u2566\u2550\u2566\u2550\u2566\u2550\u2566\u2550\u2557\n7\u2551X\u2551 \u2551 \u2551 \u2551 \u2551 \u2551O\u25517\n \u2560\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u2563\n6\u2551 \u2551 \u2551 \u2551 \u2551 \u2551 \u2551 \u25516\n \u2560\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u2563\n5\u2551 \u2551 \u2551 \u2551 \u2551 \u2551 \u2551 \u25515\n \u2560\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u2563\n4\u2551 \u2551 \u2551 \u2551 \u2551 \u2551 \u2551 \u25514\n \u2560\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u2563\n3\u2551 \u2551 \u2551 \u2551 \u2551 \u2551 \u2551 \u25513\n \u2560\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u2563\n2\u2551 \u2551 \u2551 \u2551 \u2551 \u2551 \u2551 \u25512\n \u2560\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u256c\u2550\u2563\n1\u2551O\u2551 \u2551 \u2551 \u2551 \u2551 \u2551X\u25511\n \u255a\u2550\u2569\u2550\u2569\u2550\u2569\u2550\u2569\u2550\u2569\u2550\u2569\u2550\u255d\n  a b c d e f g\nTurn: X\n```\n\n* FEN parsing\n```Python3\n>>> board = ataxx.Board(\"startpos\")\n>>> board = ataxx.Board(\"x5o/7/2-1-2/7/2-1-2/7/o5x x 0 1\")\n```\n\n* Result detection\n```Python3\n>>> board.gameover()\nTrue\n>>> board.fifty_move_draw()\nFalse\n>>> board.max_length_draw()\nFalse\n```\n\n* Communication with UAI compatible engines\n```Python3\n>>> import ataxx.uai\n>>> engine = ataxx.uai.Engine(\"tiktaxx\")\n>>> engine.uai()\n>>> engine.isready()\n>>> engine.name\n'Tiktaxx'\n>>> board = ataxx.Board()\n>>> engine.position(board)\n>>> bestmove, ponder = engine.go(movetime=1000)\n>>> engine.go(movetime=1000)\n('a7b5', None)\n>>> engine.quit()\n```\n\n* Simple players\n```Python3\n>>> import ataxx.players\n>>> board = ataxx.Board()\n>>> move = ataxx.players.greedy(board)\n>>> print(move)\nf2\n```\n\n* PGN writing\n```Python3\n>>> import ataxx.pgn\n>>> board = ataxx.Board()\n>>> board.makemove(ataxx.Move.from_san(\"a7c5\"))\n>>> board.makemove(ataxx.Move.from_san(\"b2\"))\n>>> game = ataxx.pgn.Game()\n>>> game.from_board(board)\n>>> print(game)\n[Event \"Example\"]\n[Result \"*\"]\n\n1. a7c5 b2 *\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "python-ataxx is written in Python 3 and supports basic features such as move generation, move validation, engine communication, and board printing.",
    "version": "2.2.0",
    "project_urls": {
        "Homepage": "https://github.com/kz04px/python-ataxx"
    },
    "split_keywords": [
        "ataxx"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0bb0b4f46ade153fd20abf10e8f84a2bc589a0ffbf5611083085710e208bc195",
                "md5": "94c96bcc2dd8014344adca1b1a9e8ac4",
                "sha256": "08bb9322774a677fd49b38a3ce6e0fcfa1af0592e19083b795604f64170cf0cb"
            },
            "downloads": -1,
            "filename": "ataxx-2.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "94c96bcc2dd8014344adca1b1a9e8ac4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 15100,
            "upload_time": "2024-03-12T17:51:21",
            "upload_time_iso_8601": "2024-03-12T17:51:21.616806Z",
            "url": "https://files.pythonhosted.org/packages/0b/b0/b4f46ade153fd20abf10e8f84a2bc589a0ffbf5611083085710e208bc195/ataxx-2.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "630a3217240d56171992a01bcadc5e371f3a04b252ddfad97363cbe95ec430fd",
                "md5": "fa7c033c934ed929de9860c115580dbc",
                "sha256": "61b30b32172fee8292b895c0f6f1247d63280377d42bb7fcf5ad7a3cda1ebb41"
            },
            "downloads": -1,
            "filename": "ataxx-2.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "fa7c033c934ed929de9860c115580dbc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22662,
            "upload_time": "2024-03-12T17:50:00",
            "upload_time_iso_8601": "2024-03-12T17:50:00.585592Z",
            "url": "https://files.pythonhosted.org/packages/63/0a/3217240d56171992a01bcadc5e371f3a04b252ddfad97363cbe95ec430fd/ataxx-2.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-12 17:50:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kz04px",
    "github_project": "python-ataxx",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ataxx"
}
        
Elapsed time: 0.20481s