Giter Site home page Giter Site logo

tempai-core's Issues

Can it correctly calculate the shanten for less than 13 tiles case?

thank you for this go package. I have two problems with it.

  1. how can I get the right shanten value for less than 13 tiles case? the same case in tempai.net is right, "11223m55p1z" best drop is 1z, shanten value is 0, but use these package, it got 5, all less than 13 tiles case will get the wrong answer.
  2. I found that when tenhon and tempai.net calculate the effective, If there is 3n+1 tiles in hand, it will be completed to 3n+2, but effective.Calculate() won't do that, it will get a wrong answer with 3n+1 tiles. Does anyone need the effective with 3n+1 tiles? if I want to completed the 3n+2nd tile, what rule should I use ?

Issue with Riichi Mahjong Points Calculation

I am using this package for calculating Riichi mahjong points. I've noticed an inconsistency when handling special hands, particularly with YakumanTenhou and YakumanKokushi13.

Problem Description:

When setting ctx.IsFirstTake = true and providing a Kokushi13 tile set, both YakumanTenhou and YakumanKokushi13 should be valid simultaneously. However, only YakumanKokushi13 gets registered.

The root cause appears to be in the func (c *calculator) run() *Result method. If c.tryKokushi() returns true, the function immediately proceeds to c.calculateResult(), bypassing the c.tryTsumo() method where YakumanTenhou is determined and added.

Expected Behavior:

Both YakumanTenhou and YakumanKokushi13 should be recognized and calculated correctly when the conditions are met.

Suggested Solution:

Adjust the function's control flow to ensure that c.tryTsumo() is called even when c.tryKokushi() returns true.

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.