Skip to main content

BadukID

Convert board state to a unique id. Lower ids are assigned to boards with fewer stones.

Installation

python3 -m pip install baduk-id

Usage

from baduk_id.baduk_id import encode, decode

# board state should be a 1-D array with 361 elements
# 0=empty 1=black, 2=white
FLYING_KNIFE = (
    [0] * 19
    + [0] * 12 + [1, 2, 0, 0, 0, 0, 0]
    + [0] * 12 + [0, 1, 2, 2, 2, 0, 0]
    + [0] * 12 + [0, 1, 2, 1, 1, 0, 0]
    + [0] * 12 + [0, 0, 1, 2, 0, 0, 0]
    + [0] * 19 * 14)

flying_knife_id = encode(FLYING_KNIFE)
# The value of board_state will be equivalent to FLYING_KNIVE
board_state = decode(flying_knife_id)

Release files for baduk-id 0.1.2

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

Source distribution (sdist)

Source distribution for baduk-id 0.1.2
File Size Uploaded
baduk-id-0.1.2.tar.gz 3.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for baduk-id 0.1.2
File Interpreter ABI Platform
baduk_id-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.3 kB

Release files / baduk-id-0.1.2.tar.gz

Download URL baduk-id-0.1.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
95c8dceebf99d342a204fda630e0bcaa746dd12e6b30744d52db0ab1e03ce74b
BLAKE2b-256 checksum
How to use checksums
29508711a2b1d6b4ce6d4793f84914789368cf97c42bd779966d1a2b7d1e3c75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.6

Release files / baduk_id-0.1.2-py3-none-any.whl

Download URL baduk_id-0.1.2-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53400561fc42210af2de9b4415db15fbf2c0d458f860dfe334694eab03b2f6e2
BLAKE2b-256 checksum
How to use checksums
ead90fa11d006de7406e95e014716de8c55c781b8910a69fd87eccfc67687891
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

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