I am using this package for calculating Riichi mahjong points. I've noticed an inconsistency when handling special hands, particularly with YakumanTenhouand 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.
I am using this package for calculating Riichi mahjong points. I've noticed an inconsistency when handling special hands, particularly with
YakumanTenhou
andYakumanKokushi13
.Problem Description:
When setting ctx.IsFirstTake = true and providing a Kokushi13 tile set, both
YakumanTenhou
andYakumanKokushi13
should be valid simultaneously. However, onlyYakumanKokushi13
gets registered.The root cause appears to be in the
func (c *calculator) run() *Result
method. Ifc.tryKokushi()
returns true, the function immediately proceeds to c.calculateResult(), bypassing thec.tryTsumo()
method whereYakumanTenhou
is determined and added.Expected Behavior:
Both
YakumanTenhou
andYakumanKokushi13
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 whenc.tryKokushi()
returns true.