Replies: 2 comments 11 replies
-
|
Regarding Topic 2: The current algorithm does not appear to return a consistent shanten number for a hand of 3n tiles. Example: # ruff: noqa: D103, T201
from mahjong.shanten import Shanten
from mahjong.tile import TilesConverter
def print_shanten(mpsz: str) -> None:
tiles = TilesConverter.one_line_string_to_34_array(mpsz)
print(f"shanten for {mpsz}: {Shanten.calculate_shanten(tiles)}")
print_shanten("")
print()
print_shanten("1m")
print_shanten("12m")
print_shanten("123m")
print_shanten("124m")
print_shanten("135m")
print()
print_shanten("1m")
print_shanten("11m")
print_shanten("111m")Output: |
Beta Was this translation helpful? Give feedback.
-
|
Regarding Topic 3 Personally, I'm reluctant to change or add to the algorithm. There are roughly three methods for calculating Shanten numbers:
Each method has its own issues.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
-> resolved in bug: stabilize shanten input validation #242
-> not to change
Beta Was this translation helpful? Give feedback.
All reactions