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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file shantenx-0.1.11-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: shantenx-0.1.11-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 354.3 kB
- Tags: PyPy, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dece16dd9e875716d13754fb5f12a52e920a71afffc744f29dc909c81d25db3 |
|
MD5 | 366cb17dacd79123afaaeeeec65b50ea |
|
BLAKE2b-256 | 5f01728c52e97308e2a2139797195296406f727f2a7d88a630ac4f676b8de4e1 |
File details
Details for the file shantenx-0.1.11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: shantenx-0.1.11-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 351.6 kB
- Tags: CPython 3.10, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 930b894256891b6beb5399961a309181a999ee39f2b44e760a1c1ba08f88251b |
|
MD5 | 240147014cbb9b3c84246d941db2166b |
|
BLAKE2b-256 | b9e9bf68b57555a224873bacd1dbcc258c04553e85bf768233d5cd6a29cac06b |
File details
Details for the file shantenx-0.1.11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: shantenx-0.1.11-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 351.4 kB
- Tags: CPython 3.9, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8b239f33fe94a656320fe5ddfd50d74b5995f4c69efd3d4c4a76b0f846b53a1 |
|
MD5 | 4e6cb5b6a4c144688a001f8bf0f01e1e |
|
BLAKE2b-256 | 2fa6bf901f4b27d7ef90ace7d60911c49968fa73ad335c70f7f8ea3a1e12a830 |
File details
Details for the file shantenx-0.1.11-cp39-cp39-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: shantenx-0.1.11-cp39-cp39-macosx_10_7_x86_64.whl
- Upload date:
- Size: 332.4 kB
- Tags: CPython 3.9, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd11c2014a0588972ffba9a55cabb6caa8b65ce05add2ab8f0c044749709f239 |
|
MD5 | 3102b905a54f23ecce68de773f6cd773 |
|
BLAKE2b-256 | e4f4fac85b396fef3d802409cac2bdcf2d7c5727e2449c4a4cb4a8c95b58bddf |
File details
Details for the file shantenx-0.1.11-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: shantenx-0.1.11-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 351.8 kB
- Tags: CPython 3.8, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfe8e73bd669e0c99959af744bc55c261fc57cea11bccc0629ca0334b90415b1 |
|
MD5 | 3d4da73dd6118fe962c4fef9c797b0cb |
|
BLAKE2b-256 | c76324e9868daddbd3219669f2b1d8ad0286418e0bb9735ce8409ca4ce41d007 |
File details
Details for the file shantenx-0.1.11-cp38-cp38-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: shantenx-0.1.11-cp38-cp38-macosx_10_7_x86_64.whl
- Upload date:
- Size: 332.8 kB
- Tags: CPython 3.8, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e62eb77acc2efbb9be38640c6326c894cda166cc58aca3bc221eced3189ad5f6 |
|
MD5 | d2a92d89fa6052263c1eadfeac77ca7a |
|
BLAKE2b-256 | f081671429a9ccd53d3b135fe4191d6f1c627a9a10531d5041a776431a7ba96b |
File details
Details for the file shantenx-0.1.11-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
.
File metadata
- Download URL: shantenx-0.1.11-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 351.8 kB
- Tags: CPython 3.7m, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/0.12.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54da2604c7f3e53af1b3c092b23fed425944fefcd82b87fa785949360c78cb2a |
|
MD5 | 3540a8b7e031fcf8a130b1e1bdf6cadb |
|
BLAKE2b-256 | d3081f73ae43a22227303c8abc2b107b006197a43f98e23c438ae82e56275ce3 |