Skip to main content

No project description provided

Project description

shantenx

麻雀におけるシャンテン数の計算を提供します.

features

max_fans

limit 枚以下の牌の入れ替えにより, 最大何翻の聴牌が作れるかを返します.

引数名 概要 e.g. default
pure 純手牌 ['1m','1m','1m','2m','3m','4m','5m']
furo 副露 ['123m','666s','1111m','3__3z']
limit 0, 1, 2, ...
dora ドラ ['1m', '1m', '6z']
bakaze 場風 '1z', '2z', '3z', '4z'
jikaze 自風 '1z', '2z', '3z', '4z'
red_manzu 赤5萬の有無 True, False False
red_pinzu 赤5筒の有無 True, False False
red_souzu 赤5索の有無 True, False False

以下の役満を考慮します.

  • ダブル役満 (26翻)
    • 大四喜
    • 純正九蓮宝燈
  • 役満 (13翻)
    • 国士無双
    • 四槓子
    • 四暗刻
    • 大三元
    • 小四喜
    • 字一色
    • 清老頭
    • 緑一色
    • 九蓮宝燈

これらを含まない場合, 以下の通常役を考慮します. ただし13翻以上の場合は 13翻を返します.

  • ドラ
  • 赤ドラ
  • 断么
  • 混老頭
  • 清一色
  • 混一色
  • 自摸
  • 立直 (TODO)
  • 三槓子
  • 小三元
  • 七対子
  • 対々和
  • 三暗刻
  • 平和
  • 役牌
  • 一盃口
  • 二盃口
  • 純チャン
  • チャンタ
  • 一気通貫
  • 三色同順
  • 三色同刻

Examples

import shantenx
assert(shantenx.max_fans(
    pure=['1m','1m','1m','2m','3m','4m','5m','6m','7m','8m','9m','9m','9m'],
    furo=[],
    limit=0,
    dora=[],
    jikaze='1z',
    bakaze='2z') == 26)

Verify

python3 pytest/test.py -t pytest/resources/shanten-online-testcases.json

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

shantenx-0.1.10-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (354.1 kB view details)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

shantenx-0.1.10-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (351.5 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

shantenx-0.1.10-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (351.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

shantenx-0.1.10-cp39-cp39-macosx_10_7_x86_64.whl (332.3 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

shantenx-0.1.10-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl (351.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.5+ x86-64

shantenx-0.1.10-cp38-cp38-macosx_10_7_x86_64.whl (332.7 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

shantenx-0.1.10-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (351.8 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

File details

Details for the file shantenx-0.1.10-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for shantenx-0.1.10-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 270131c4fa6db990ea71d65320d92b3ae740608ad34bf48b055a09b92097d722
MD5 b0d668ba88024b5211259e9e11c62947
BLAKE2b-256 099ffa7bae08cfcb244b54f50692442345a2358b301046105e753a29081ff199

See more details on using hashes here.

File details

Details for the file shantenx-0.1.10-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for shantenx-0.1.10-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7096def8858d9dbfef25a90418dde9d6b284b621922c85f4545c2759c140497e
MD5 b8322e9030347f093f90c9dfc0a40782
BLAKE2b-256 56af0f0e7a7dad2c10bbe044418e49fca36ad9ee6b58d1717213601461056593

See more details on using hashes here.

File details

Details for the file shantenx-0.1.10-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for shantenx-0.1.10-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 87fb32db4a609e00fede2f6f01fa3dda0d7ee67c05af608b199ad22de44c44cd
MD5 9d49a37cdb5415a23628cccdfe8ebab0
BLAKE2b-256 afb49d76e745efc9b35c992928722fb4ddb5c9cfd638e3d306fb6bea92bec4de

See more details on using hashes here.

File details

Details for the file shantenx-0.1.10-cp39-cp39-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for shantenx-0.1.10-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 b9880521bd6dab6143c364ca91720a2ddd1fd9a4af53e3b64cae987646253bb1
MD5 0a8b15cc327ac7261bcdba79074e8a5e
BLAKE2b-256 4a3fe123614e3a0703de9b11abdf0961f07f5bf574efc7195f449a93b98da3a8

See more details on using hashes here.

File details

Details for the file shantenx-0.1.10-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for shantenx-0.1.10-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 6dac60838053b2f665b872481208593736772cfaf2fa9361f0d28a2a7e0ed277
MD5 14aa7f9ce9c89faccf51f73888a2d2b1
BLAKE2b-256 48571098e7b94f67de44c8840bc3d837cc8987694c2feca890ea2ff2a6bf699d

See more details on using hashes here.

File details

Details for the file shantenx-0.1.10-cp38-cp38-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for shantenx-0.1.10-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 d8895a86ba6609cdd74253cb74a5f08d5ffaf99b00df2f685baab08e0f5c8091
MD5 9276caf600c72def7ccd501d23fbfe2b
BLAKE2b-256 0ca5cad3bc9ca223ea1e7cde4a0ba820efae29cf6594c6b7cf0be7ceff6fe9e3

See more details on using hashes here.

File details

Details for the file shantenx-0.1.10-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for shantenx-0.1.10-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 020213782519e477d2f43d5019914b97b3d2f07c1c292cd9c555a4b98deb0aa8
MD5 4a958d3471aa5de5272ce756783d68be
BLAKE2b-256 ae679fa2eba4ca45be66712efb556a6706fe580b38db70a65872de91d7026b63

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page