ssttkkl / mahjong-utils Goto Github PK
View Code? Open in Web Editor NEWRiichi Mahjong Pairi Algorithm Library (Kotlin Multiplatform)
Home Page: https://mahjong-utils-docs.vercel.app/
License: MIT License
Riichi Mahjong Pairi Algorithm Library (Kotlin Multiplatform)
Home Page: https://mahjong-utils-docs.vercel.app/
License: MIT License
依赖:
io.github.ssttkkl
mahjong-utils-jvm
0.6.5
调用:
List tiles = Tile.Companion.parseTiles("1z1z1z2z2z2z3z3z3z4z4z4z4z"); // 13张牌
ShantenResult rs = ShantenKt.shanten(tiles);
System.out.println(rs.getShantenInfo().getShantenNum());
输出结果为0(听牌),但正确结果应该为1(一向听)
如果输入为"1z1z1z2z2z2z3z3z3z3z4z4z4z4z"(14张牌),输出结果也是0,但正确结果应该为1
https://github.com/nekobean/mahjong-cpp
https://pystyle.info/mahjong-expected-value-in-mahjong/
这位作者提出了一个比较简单的古典概型用于计算听牌概率、和牌概率、点数期望的计算,可以考虑参考实现一下
Error when trying to import mahjong_utils:
Traceback (most recent call last):
File "T:\get_reward\get_reward.py", line 4, in <module>
import mahjong_utils
File "T:\get_reward\VENV\lib\site-packages\mahjong_utils\__init__.py", line 1, in <module>
from . import hora
File "T:\get_reward\VENV\lib\site-packages\mahjong_utils\hora\__init__.py", line 1, in <module>
from .hora import *
File "T:\get_reward\VENV\lib\site-packages\mahjong_utils\hora\hora.py", line 10, in <module>
from mahjong_utils.shanten import ShantenResult
File "T:\get_reward\VENV\lib\site-packages\mahjong_utils\shanten\__init__.py", line 1, in <module>
from .models import *
File "T:\get_reward\VENV\lib\site-packages\mahjong_utils\shanten\models.py", line 262, in <module>
class RegularShantenResult(CommonShantenResult[RegularHandPattern]):
File "T:\get_reward\VENV\lib\site-packages\pydantic\main.py", line 591, in __class_getitem__
raise TypeError(f'{cls} is not a generic class')
TypeError: <class 'mahjong_utils.shanten.models.CommonShantenResult'> is not a generic class
Tested under windows 11, Python 3.10.6 and Python 3.11.4
如果机会牌能够构成和牌,返回结果的向听数应该是-1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.