Giter VIP home page Giter VIP logo

mjlegal's People

Contributors

yuufyu avatar

Watchers

 avatar

Forkers

0num4

mjlegal's Issues

extra_anpaisに同じ牌が多重に追加される

現象

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

エラー再現Test

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]}

v0.0.1

初期動作版.
以下の状態に持っていく

  • 雀魂ルール(3人麻雀)
  • mjaiプロトコルに対する合法手生成

以下は対象外

  • 4人麻雀
  • 各種ルール対応
  • 実際の牌譜を利用した評価

v0.1.0beta

mjlegal v0.1.0beta
Main planned features for the new beta version:

  • Refactor
  • New API style
  • etc

PlayerState.scoreが変わらない

"reach", "hora", "ryukyoku"などで"score"プロパティをハンドリングしていないため、得点(score)が初期点から変わらない。
立直など残り点数によって可否が変わるアクションが正しく動作しない(はず)。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.