Beta

Play Chinese MahJong , Win the Game, Get the Money!

Description
Loading description...
Games
Algorithms
  • Please sign in or sign up to leave a comment.
  • Voile Avatar

    This kata turns out to be a duplicate of https://www.codewars.com/kata/56fd0d6445040066b4001e04

  • 4500zenja1 Avatar

    So there is some misstype stuff in the description and such:

    1. unusual winning pattern - thirteen with one, 十三幺

    I feel like that should be called "Thirteen orphans" (please look here );

    1. '鸟,4条,2饼,5饼,8饼,3万,6万,9万,东,南,北,中,发,白',# independeBce <-- independeNce?

    2. '东,南,西,北,中,发,白,1万,9万,1饼,9饼,鸟,9条,白',# thirteen_with_seven

    Why is it thirteen_with_seven, when in description there's a thirteen with one combination?

  • Just4FunCoder Avatar
    1. It is stated in the description of unusual winning pattern - independence, 全不靠:

      Each tile is belong to {east,south,west,north,middle,rich, blank} and (1,4,7)(million), (2,5,8)(pancakes), (3,6,9)(worm) THE MILLION,PANCAKES,AND WORM IN PARENTHESES ABOVE ARE INTERCHANGABLE!

    But the actual testcase only tested one of the possibilities (always within ['1万', '4万', '7万', '8饼', '2饼', '5饼', '9条', '3条', '6条']). Consider shuffling array a / b before zipping them together, do beware that "1条" might be randomly generated and need to be converted to "鸟".

    1. Testcase can and often generate invalid hands: eg: normal [白,5万,9万,4万,9万,6万,3万,9万,9万,白,9万,5万,7万,9万] (six 9万 here), seven pairs [白,白,白,白,白,白,白,白,白,白,白,白,白,白].

    2. Off by 1 error while printing the function name, eg. ("hirteen_with_one", "ormal", "nependence", ...)

    1. Description is hard to read in light mode due to black background, consider giving them a white font?

    unread

    • Forth-power Avatar

      Thank you very much!!!:D

      1. Now the check points are generated by shuffled list.
      2. I add a decorator to validate the patterns.
      3. Sorry for my carelessness :(
      4. I fixed the css, now you can read discription explicitly.
      Issue marked resolved by Forth-power 3 years ago
  • scarecrw Avatar

    Description and tests are inconsistent about if there should be a 1条 tile or not. It's not included in the alll variable, but it's in the thirteen variable, but not in the thirteen test case, but in the independence test case...

    • Forth-power Avatar

      Sorry, fixed. Now all '1条' is replace by '鸟'. : )

      Issue marked resolved by Forth-power 3 years ago
    • Just4FunCoder Avatar

      There's still one testcase containing "1条" - see the third from last item in the param array in actual testcase

      1条,4条,2饼,5饼,8饼,3万,6万,9万,东,南,北,中,发,白',# independebce
      
  • LanXnHn Avatar

    Did I need to consider Kong(杠)?

    It will change the amount of tiles to win.

    • Voile Avatar

      Kong moves tiles outside your hand. It also requires you to draw one tile, so you wouldn't be having the same tiles anymore.

      (Also, it is perfectly fine to have a winning hand with 4 of a kind. Typically that's one of the reasons you don't Kong even if you can.)

    • LanXnHn Avatar

      That is correct, just want to know if the test cases would include the case of having more than 14 tiles due to Kong.

    • LanXnHn Avatar

      In that case, I have to remove those tiles used in Kong, then check for winning.

    • Voile Avatar

      Technically Kong is irrelevant to winning hand anyway (just like Chi and Pon has nothing to do with winning hand); when considering a winning hand you only check the tiles you have in your hand.

      Question marked resolved by Voile 2 years ago
  • Voile Avatar

    Random tests are kinda pointless if the expected result always have the same order. They should be mixed together.

  • Voile Avatar

    14 tiles are same

    ? There are only 4 of a same tile in a Mahjong set. How is this even possible?

    • Voile Avatar

      Similarly, 1万,2万,3万,4万,5万,6万,7饼,8饼,9饼,白,白,白,白,白 is not a valid hand: there cannot be 5 of the same tiles in a Mahjong set.

    • Forth-power Avatar

      Sorry, my fault. Now I fixed the definition of clearity:)

      Issue marked resolved by Forth-power 3 years ago
    • Voile Avatar

      Does it even make sense? 1万,2万,3万,4万,5万,6万,1万,2万,3万,4万,5万,6万,3万,4万 isn't a winning hand in any Mahjong rules (clearity is a bonus, not a winning criteria).

    • Forth-power Avatar

      Urr...Sorry, I have deleted clearity