Skip to main content

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

Metadata

Release files for shantenx 0.1.12

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

Built distributions (wheels)

Table of built distributions (wheels) for shantenx 0.1.12
File
shantenx-0.1.12-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl PyPy 3.7 PyPy 3.7 7.3 Linux glibc 2.5+ x86-64 Details
shantenx-0.1.12-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.5+ x86-64 Details
shantenx-0.1.12-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.5+ x86-64 Details
shantenx-0.1.12-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.5+ x86-64 Details
shantenx-0.1.12-cp39-cp39-macosx_10_7_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.7+ x86-64 Details
shantenx-0.1.12-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.5+ x86-64 Details
shantenx-0.1.12-cp38-cp38-macosx_10_7_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.7+ x86-64 Details
shantenx-0.1.12-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64 Details

Total release size: 2.8 MB

Release files / shantenx-0.1.12-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL shantenx-0.1.12-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 354.3 kB
Tags Linux glibc 2.5+ x86-64 PyPy 3.7 PyPy 3.7 7.3
SHA-256 checksum
How to use checksums
569555d1700c434a22c1598faff7198a577b272812666ed2c1205ed49cd33b16
BLAKE2b-256 checksum
How to use checksums
dbbe97ee7c03018ce14eab829f3907e707df13b50b8bfb0b0eef9e8dde3ba897
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.19

Release files / shantenx-0.1.12-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL shantenx-0.1.12-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 351.8 kB
Tags CPython 3.11 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
18e358153abec520215eb334efa132f33cce0653601a7415312602791224748b
BLAKE2b-256 checksum
How to use checksums
742f2e532a2a543d2cf8b66bd4ebf7a05ece52c11705440c8695104b196d4cae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.19

Release files / shantenx-0.1.12-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL shantenx-0.1.12-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 351.7 kB
Tags CPython 3.10 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
2e06581e07a8ab82ac3d2850b0099a5fd48cc8e32634392a7c2fe19bac1fd892
BLAKE2b-256 checksum
How to use checksums
440af8d038f37a2a969843ffc4090d7cff46a050cb5adbf264b45131c91a15d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.19

Release files / shantenx-0.1.12-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL shantenx-0.1.12-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 351.7 kB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
ed57bc05769b8650214664219647d534c81e43fb8dad940489b8be0769e19625
BLAKE2b-256 checksum
How to use checksums
13c34c172042260844959375e86c8c9f62e393791c079b6ba1514adeafe5b640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.19

Release files / shantenx-0.1.12-cp39-cp39-macosx_10_7_x86_64.whl

Download URL shantenx-0.1.12-cp39-cp39-macosx_10_7_x86_64.whl
Size 333.5 kB
Tags CPython 3.9 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
8e4048a1360426ab4b5e47eca207c34d7aa039c99bdad377cfd2ac0b1d36c37b
BLAKE2b-256 checksum
How to use checksums
f4e8244105920e5c1695e4569295fdc8c92a5388aa506f2e8ab72142a9cbd675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.19

Release files / shantenx-0.1.12-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL shantenx-0.1.12-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 351.8 kB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
98b9d6f7310cc27383dec4dfe2823b75bde38f1fb808a248a4c0af9e7e58732f
BLAKE2b-256 checksum
How to use checksums
b62b0419723c29e484fc2929f27f572626443d806048909a8180c4d34ca0fdc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.19

Release files / shantenx-0.1.12-cp38-cp38-macosx_10_7_x86_64.whl

Download URL shantenx-0.1.12-cp38-cp38-macosx_10_7_x86_64.whl
Size 333.5 kB
Tags CPython 3.8 macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
a24d8fda8851d17c78c2d484a0669e346aa56577d22371f0244380fcce7b7554
BLAKE2b-256 checksum
How to use checksums
cd998be2aa1d9592195e5f4002d49d60feafcf4f57bfb8daa2ffe0d63f690ff7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.19

Release files / shantenx-0.1.12-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl

Download URL shantenx-0.1.12-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Size 351.8 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
2c7470f2ce921b63fa8268a9ed3fdd9758036071c9f8974b631d99ddb2949600
BLAKE2b-256 checksum
How to use checksums
f7a961dcbded1c4879870e75128a5482986669bef283ca193954e931d079839d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.12.19

Release history Release notifications | RSS feed

This release

0.1.12 This release

8 release files

0.1.11

7 release files

0.1.10

7 release files

0.1.9

7 release files

0.1.8

3 release files

0.1.6

3 release files

0.1.4

2 release files

0.1.3

3 release files

0.1.2

3 release files

0.1.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