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.12-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl (354.3 kB view details)

Uploaded PyPy manylinux: glibc 2.5+ x86-64

shantenx-0.1.12-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl (351.8 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.5+ x86-64

shantenx-0.1.12-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (351.7 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

shantenx-0.1.12-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (351.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

shantenx-0.1.12-cp39-cp39-macosx_10_7_x86_64.whl (333.5 kB view details)

Uploaded CPython 3.9 macOS 10.7+ x86-64

shantenx-0.1.12-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.12-cp38-cp38-macosx_10_7_x86_64.whl (333.5 kB view details)

Uploaded CPython 3.8 macOS 10.7+ x86-64

shantenx-0.1.12-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.12-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for shantenx-0.1.12-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 569555d1700c434a22c1598faff7198a577b272812666ed2c1205ed49cd33b16
MD5 db9b121d63d9a2f2e033176bcdc2dde6
BLAKE2b-256 dbbe97ee7c03018ce14eab829f3907e707df13b50b8bfb0b0eef9e8dde3ba897

See more details on using hashes here.

File details

Details for the file shantenx-0.1.12-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for shantenx-0.1.12-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 18e358153abec520215eb334efa132f33cce0653601a7415312602791224748b
MD5 3bd1af6a1b5b58147518f91077bd9052
BLAKE2b-256 742f2e532a2a543d2cf8b66bd4ebf7a05ece52c11705440c8695104b196d4cae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shantenx-0.1.12-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2e06581e07a8ab82ac3d2850b0099a5fd48cc8e32634392a7c2fe19bac1fd892
MD5 0aa2f5e953dbcc85894815a0a3aef8aa
BLAKE2b-256 440af8d038f37a2a969843ffc4090d7cff46a050cb5adbf264b45131c91a15d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shantenx-0.1.12-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ed57bc05769b8650214664219647d534c81e43fb8dad940489b8be0769e19625
MD5 a97190f38a9dddb271bfa53c6d79b7f6
BLAKE2b-256 13c34c172042260844959375e86c8c9f62e393791c079b6ba1514adeafe5b640

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shantenx-0.1.12-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 8e4048a1360426ab4b5e47eca207c34d7aa039c99bdad377cfd2ac0b1d36c37b
MD5 a4ba9204aaaaba15975eade39cf4cd07
BLAKE2b-256 f4e8244105920e5c1695e4569295fdc8c92a5388aa506f2e8ab72142a9cbd675

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shantenx-0.1.12-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 98b9d6f7310cc27383dec4dfe2823b75bde38f1fb808a248a4c0af9e7e58732f
MD5 04dd0d03ae1809c5849d97943c9dea35
BLAKE2b-256 b62b0419723c29e484fc2929f27f572626443d806048909a8180c4d34ca0fdc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shantenx-0.1.12-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 a24d8fda8851d17c78c2d484a0669e346aa56577d22371f0244380fcce7b7554
MD5 e6f613cf854cedebeff4406277beafcb
BLAKE2b-256 cd998be2aa1d9592195e5f4002d49d60feafcf4f57bfb8daa2ffe0d63f690ff7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for shantenx-0.1.12-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 2c7470f2ce921b63fa8268a9ed3fdd9758036071c9f8974b631d99ddb2949600
MD5 9a7ade9692850f316aed5d5a406b7014
BLAKE2b-256 f7a961dcbded1c4879870e75128a5482986669bef283ca193954e931d079839d

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