Skip to main content
https://github.com/michalskibinski109/checkers/actions/workflows/python-app.yml/badge.svg https://badge.fury.io/py/fast_checkers.svg

Draughts

Project still under active developement. Still lacking some important functionality.

Efficient Modern and flexible implementation of draughts game with beautiful web interface. Supports multiple variants of the game and allows to play against AI.

Documentation

Installation

python -m pip install py-draughts

Usage

simple

>>> import draughts.american as draughts

>>> board = draughts.Board()
---------------------------------
|   | x |   | x |   | x |   | x |
---------------------------------
| x |   | x |   | x |   | x |   |
---------------------------------
|   | x |   | x |   | x |   | x |
---------------------------------
|   |   |   |   |   |   |   |   |
---------------------------------
|   |   |   |   |   |   |   |   |
---------------------------------
| o |   | o |   | o |   | o |   |
---------------------------------
|   | o |   | o |   | o |   | o |
---------------------------------
| o |   | o |   | o |   | o |   |

Moving pieces

>>> board.push_from_str("24-19")
>>> board.push_from_str("12-16")
>>> board.push_from_str("23-18")
>>> board.push_from_str("16x23")
>>> board.push_from_str("26x19")
>>> board.pop()
>>> print(board)
---------------------------------
|   | x |   | x |   | x |   | x |
---------------------------------
| x |   | x |   | x |   | x |   |
---------------------------------
|   | x |   | x |   | x |   |   |
---------------------------------
|   |   |   |   |   |   |   |   |
---------------------------------
|   |   |   | o |   |   |   |   |
---------------------------------
| o |   | o |   | x |   |   |   |
---------------------------------
|   | o |   | o |   | o |   | o |
---------------------------------
| o |   | o |   | o |   | o |   |
>>> print(list(board.legal_moves))
[Move: 21->17, Move: 22->18, Move: 22->17, Move: 23->19, Move: 23->18, Move: 24->20, Move: 24->19]

Creating custom board

import draughts.base as draughts
import numpy as np
CUSTOM_POSITION = np.array([1] * 20 + [-1] * 12, dtype=np.int8)
board = draughts.BaseBoard(starting_position=CUSTOM_POSITION)
board.legal_moves = ... # create your own custom legal_moves method (property)

UI

from draughts.server import Server
Server().run()

It is as simple as that!

https://github.com/michalskibinski109/draughts/assets/77834536/4ec36e49-38cc-45e8-a500-d0d24b21fce7 https://github.com/michalskibinski109/draughts/assets/77834536/b7e0bf73-1bc5-4769-8f82-a22cde3b7e90

pseudo legal moves for selected square

https://github.com/michalskibinski109/draughts/assets/77834536/ef64179a-1e7d-46d4-991e-5a34fc803d7e

Contributing

Contributions to this project are welcome. If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the project repository.

Bibliography

  1. notation

  2. rules and variants

  3. list of pdns

  4. droughts online

  5. additional 1 (checkers online)

  6. additional 2 (chinook)

Release files for py-draughts 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-draughts 0.3.1
File Size Uploaded
py-draughts-0.3.1.tar.gz 30.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-draughts 0.3.1
File Interpreter ABI Platform
py_draughts-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 61.6 kB

Release files / py-draughts-0.3.1.tar.gz

Download URL py-draughts-0.3.1.tar.gz
Size 30.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bb43db070a36d0a14b0ef775f5fcfc72a09597d1a5c261024cab2e935b2d8027
BLAKE2b-256 checksum
How to use checksums
e81f94d9033707fa33ecfe9e8abf9118dd12168dcff8cfcebdf37abad5d52479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / py_draughts-0.3.1-py3-none-any.whl

Download URL py_draughts-0.3.1-py3-none-any.whl
Size 31.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d61de824553c80e749b2f23b41ac724c2ebd56f881ea9fe17c9b99e87eb91ba2
BLAKE2b-256 checksum
How to use checksums
404c339fab80bcac87fa3a6fde1ebdf59dbc511d2b86bb38652a250e60faa5e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Release history Release notifications | RSS feed

1.9.0

2 release files

1.8.4

2 release files

1.8.3

2 release files

1.8.1

2 release files

1.7.1

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.8

2 release files

1.5.5

2 release files

1.5.2

2 release files

1.5.0

2 release files

1.4.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.6

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.0

2 release files

0.9.9

2 release files

0.9.0

2 release files

This release

0.3.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page