yuufyu / mjlegal Goto Github PK
View Code? Open in Web Editor NEW麻雀の合法手を生成するプログラム(開発中)
麻雀の合法手を生成するプログラム(開発中)
MjaiLoader.actionはprevious_actionを使ってextra_anpaisを更新する(牌を追加)。
previous_actionが更新されないままMjaiLoader.actionが2回以上呼ばれる(例:action_type=noneなど)と、extra_anpaisに同じ牌が多重追加されることがある。
これによってsutehai + extra_anpaisに同じ牌が4個より多く追加されると、HandTool.is_furitenのTilesUtil.tiles_to_tiles34で期待と異なる動作をする場合がある。
https://github.com/yuugata/mjlegal/blob/ce86ae914fc37d16f692489c0e9b8a62f8525ea8/mjlegal/mjai.py#L13
ce86ae9
player0は中をsutehaiに3個, extra_anpaisに1個持つ。previous_action=dahaiのままMjaiLoader.actionを2回呼び出すと中を合計5個持つことになり、HandTool.is_furitenのTilesUtil.tiles_to_tiles34でクラッシュする。
{"type":"tsumo","actor":0,"pai":"C"}
{"type":"dahai","actor":0,"pai":"C","tsumogiri":true}
{"type":"tsumo","actor":1,"pai":"E"}
{"type":"dahai","actor":1,"pai":"F","tsumogiri":false}
{"type":"tsumo","actor":2,"pai":"3p"}
{"type":"dahai","actor":2,"pai":"P","tsumogiri":false}
{"type":"tsumo","actor":0,"pai":"C"}
{"type":"dahai","actor":0,"pai":"C","tsumogiri":true}
:
{"type":"tsumo","actor":0,"pai":"C"}
{"type":"dahai","actor":0,"pai":"C","tsumogiri":true}
{"type":"tsumo","actor":1,"pai":"C"}
{"type":"dahai","actor":1,"pai":"C","tsumogiri":true}
{"type":"ryukyoku","reason":"fanpai","tehais":[["2p","3p","4p","4p","5p","6p","7p","8p","3s","4s","5s","8s","8s"],["?","?","?","?","?","?","?","?","?","?","?","?","?"],["?","?","?","?","?","?","?","?","?","?","?","?","?"]],"tenpais":[true,false,false],"deltas":[2000,-1000,-1000,0],"scores":[27100,23800,53100,0]}
初期動作版.
以下の状態に持っていく
以下は対象外
mjlegalの評価・動作サンプルの提供を目的として、合法手をランダムに実行する麻雀AI(mjai)を作成したい。
3人麻雀用のmjaiは下記を参照。
https://github.com/yuugata/mjai/tree/3p
mjlegal v0.1.0beta
Main planned features for the new beta version:
"reach", "hora", "ryukyoku"などで"score"プロパティをハンドリングしていないため、得点(score)が初期点から変わらない。
立直など残り点数によって可否が変わるアクションが正しく動作しない(はず)。
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.