def test_atodzuke_dont_open_no_yaku_tempai(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(man='9'))

        tiles = self._string_to_136_array(man='111445', sou='567', pin='56', honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        # 6 man is bad meld, we lose our second pair and so is 4 man
        tile = self._string_to_136_tile(man='6')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        tile = self._string_to_136_tile(man='4')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        # 7 pin is a good meld, we get to tempai keeping yakuhai wait
        tile = self._string_to_136_tile(pin='7')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)
Пример #2
0
    def test_should_activate_strategy(self):
        table = Table()
        player = table.player
        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)

        tiles = self._string_to_136_array(sou='12355689',
                                          man='89',
                                          honors='123')
        player.init_hand(tiles)
        self.assertEqual(strategy.should_activate_strategy(), False)

        tiles = self._string_to_136_array(sou='12355689',
                                          man='89',
                                          honors='44')
        player.init_hand(tiles)
        player.dealer_seat = 1
        self.assertEqual(strategy.should_activate_strategy(), True)

        tiles = self._string_to_136_array(sou='12355689',
                                          man='89',
                                          honors='666')
        player.init_hand(tiles)
        self.assertEqual(strategy.should_activate_strategy(), True)

        # with chitoitsu-like hand we don't need to go for yakuhai
        tiles = self._string_to_136_array(sou='1235566',
                                          man='8899',
                                          honors='66')
        player.init_hand(tiles)
        self.assertEqual(strategy.should_activate_strategy(), False)
Пример #3
0
    def test_should_activate_strategy(self):
        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, self.player)

        tiles = self._string_to_136_array(sou='12355689',
                                          man='89',
                                          honors='123')
        self.player.init_hand(tiles)
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles),
                         False)

        self.table.dora_indicators.append(self._string_to_136_tile(honors='7'))
        tiles = self._string_to_136_array(sou='12355689',
                                          man='899',
                                          honors='55')
        self.player.init_hand(tiles)
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles),
                         True)

        # with chitoitsu-like hand we don't need to go for yakuhai
        tiles = self._string_to_136_array(sou='1235566',
                                          man='8899',
                                          honors='66')
        self.player.init_hand(tiles)
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles),
                         False)

        # don't count tile discarded by other player as our pair
        tiles = self._string_to_136_array(sou='12355689',
                                          man='899',
                                          honors='25')
        self.player.init_hand(tiles)
        tiles = self._string_to_136_array(sou='12355689',
                                          man='899',
                                          honors='255')
        self.assertEqual(strategy.should_activate_strategy(tiles), False)
    def test_dont_activate_strategy_if_we_dont_have_enough_tiles_in_the_wall(self):
        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, self.player)

        self.table.dora_indicators.append(self._string_to_136_tile(honors='7'))
        tiles = self._string_to_136_array(man='59', sou='1235', pin='12789', honors='55')
        self.player.init_hand(tiles)

        self.assertEqual(strategy.should_activate_strategy(self.player.tiles), True)

        self.table.add_discarded_tile(3, self._string_to_136_tile(honors='5'), False)
        self.table.add_discarded_tile(3, self._string_to_136_tile(honors='5'), False)

        # we can't complete yakuhai, because there is not enough honor tiles
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles), False)
Пример #5
0
    def test_atodzuke_dont_destroy_second_pair(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(man='9'))

        tiles = self._string_to_136_array(man='111445',
                                          sou='468',
                                          pin='56',
                                          honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        # 6 man is bad meld, we lose our second pair and so is 4 man
        tile = self._string_to_136_tile(man='6')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)

        tile = self._string_to_136_tile(man='4')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)

        # but if we have backup pair it's ok
        tiles = self._string_to_136_array(man='111445',
                                          sou='468',
                                          pin='88',
                                          honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        # 6 man is bad meld, we lose our second pair and so is 4 man
        tile = self._string_to_136_tile(man='6')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)

        tile = self._string_to_136_tile(man='4')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)
    def test_open_hand_and_once_discarded_tile(self):
        """
        If we have valuable pair in the hand, this tile was discarded once and we have 1+ shanten
        let's open on this valuable pair
        """

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, self.player)

        tiles = self._string_to_136_array(sou='678', pin='14689', man='456', honors='77')
        self.player.init_hand(tiles)

        # we don't activate strategy yet
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles), False)

        # let's skip first yakuhai early in the game
        tile = self._string_to_136_tile(honors='7')
        meld, _ = self.player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)

        # now one is out
        self.table.add_discarded_tile(1, tile, False)

        meld, _ = self.player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)
        self.assertEqual(self._to_string(meld.tiles), '777z')

        # but we don't need to open hand for atodzuke here
        tile = self._string_to_136_tile(pin='7')
        meld, _ = self.player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)
Пример #7
0
    def test_keep_only_yakuhai_pair(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(man='9'))
        table.add_dora_indicator(self._string_to_136_tile(man='3'))

        table.add_discarded_tile(1, self._string_to_136_tile(honors='7'),
                                 False)

        tiles = self._string_to_136_array(man='11144',
                                          sou='567',
                                          pin='156',
                                          honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        player.draw_tile(self._string_to_136_tile(pin='1'))
        discarded_tile = player.discard_tile()
        self.assertNotEqual(self._to_string([discarded_tile]), '7z')
Пример #8
0
    def test_atodzuke_keep_yakuhai_wait(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(man='9'))

        tiles = self._string_to_136_array(man='11144',
                                          sou='567',
                                          pin='567',
                                          honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        # two of 4 man tiles are already out, so it would seem our wait is worse, but we know
        # we must keep two pairs in order to be atodzuke tempai
        table.add_discarded_tile(1, self._string_to_136_tile(man='4'), False)
        table.add_discarded_tile(1, self._string_to_136_tile(man='4'), False)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        player.draw_tile(self._string_to_136_tile(man='2'))
        discarded_tile = player.discard_tile()
        self.assertEqual(self._to_string([discarded_tile]), '2m')
Пример #9
0
    def test_open_hand_and_once_discarded_tile(self):
        """
        If we have valuable pair in the hand, this tile was discarded once and we have 1+ shanten
        let's open on this valuable pair
        """

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, self.player)

        tiles = self._string_to_136_array(sou='678',
                                          pin='14689',
                                          man='456',
                                          honors='77')
        self.player.init_hand(tiles)

        # we don't activate strategy yet
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles),
                         False)

        # let's skip first yakuhai early in the game
        tile = self._string_to_136_tile(honors='7')
        meld, _ = self.player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)

        # now one is out
        self.table.add_discarded_tile(1, tile, False)

        meld, _ = self.player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)
        self.assertEqual(self._to_string(meld.tiles), '777z')

        # but we don't need to open hand for atodzuke here
        tile = self._string_to_136_tile(pin='7')
        meld, _ = self.player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)
    def test_atodzuke_dont_destroy_second_pair(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(man='9'))

        tiles = self._string_to_136_array(man='111445', sou='468', pin='56', honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        # 6 man is bad meld, we lose our second pair and so is 4 man
        tile = self._string_to_136_tile(man='6')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)

        tile = self._string_to_136_tile(man='4')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)

        # but if we have backup pair it's ok
        tiles = self._string_to_136_array(man='111445', sou='468', pin='88', honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        # 6 man is bad meld, we lose our second pair and so is 4 man
        tile = self._string_to_136_tile(man='6')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)

        tile = self._string_to_136_tile(man='4')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)
Пример #11
0
    def test_dont_activate_strategy_if_we_dont_have_enough_tiles_in_the_wall(
            self):
        table = Table()
        player = table.player
        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)

        tiles = self._string_to_136_array(sou='12355689',
                                          man='89',
                                          honors='44')
        player.init_hand(tiles)
        player.dealer_seat = 1
        self.assertEqual(strategy.should_activate_strategy(), True)

        table.add_discarded_tile(3, self._string_to_136_tile(honors='4'),
                                 False)
        table.add_discarded_tile(3, self._string_to_136_tile(honors='4'),
                                 False)

        # we can't complete yakuhai, because there is not enough honor tiles
        self.assertEqual(strategy.should_activate_strategy(), False)
Пример #12
0
    def test_dont_activate_strategy_if_we_dont_have_enough_tiles_in_the_wall(
            self):
        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, self.player)

        self.table.dora_indicators.append(self._string_to_136_tile(honors='7'))
        tiles = self._string_to_136_array(man='59',
                                          sou='1235',
                                          pin='12789',
                                          honors='55')
        self.player.init_hand(tiles)

        self.assertEqual(strategy.should_activate_strategy(self.player.tiles),
                         True)

        self.table.add_discarded_tile(3, self._string_to_136_tile(honors='5'),
                                      False)
        self.table.add_discarded_tile(3, self._string_to_136_tile(honors='5'),
                                      False)

        # we can't complete yakuhai, because there is not enough honor tiles
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles),
                         False)
    def test_should_activate_strategy(self):
        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, self.player)

        tiles = self._string_to_136_array(sou='12355689', man='89', honors='123')
        self.player.init_hand(tiles)
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles), False)

        self.table.dora_indicators.append(self._string_to_136_tile(honors='7'))
        tiles = self._string_to_136_array(sou='12355689', man='899', honors='55')
        self.player.init_hand(tiles)
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles), True)

        # with chitoitsu-like hand we don't need to go for yakuhai
        tiles = self._string_to_136_array(sou='1235566', man='8899', honors='66')
        self.player.init_hand(tiles)
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles), False)

        # don't count tile discarded by other player as our pair
        tiles = self._string_to_136_array(sou='12355689', man='899', honors='25')
        self.player.init_hand(tiles)
        tiles = self._string_to_136_array(sou='12355689', man='899', honors='255')
        self.assertEqual(strategy.should_activate_strategy(tiles), False)
Пример #14
0
    def test_atodzuke_dont_open_no_yaku_tempai(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(man='9'))

        tiles = self._string_to_136_array(man='111445',
                                          sou='567',
                                          pin='56',
                                          honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        # 6 man is bad meld, we lose our second pair and so is 4 man
        tile = self._string_to_136_tile(man='6')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        tile = self._string_to_136_tile(man='4')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertEqual(meld, None)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        # 7 pin is a good meld, we get to tempai keeping yakuhai wait
        tile = self._string_to_136_tile(pin='7')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)
    def test_open_hand_when_yakuhai_already_in_the_hand(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(honors='5'))

        tiles = self._string_to_136_array(man='46', pin='4679', sou='1348', honors='666')
        player.init_hand(tiles)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        tile = self._string_to_136_tile(sou='2')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)
Пример #16
0
    def test_open_hand_when_yakuhai_already_in_the_hand(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(honors='5'))

        tiles = self._string_to_136_array(man='46',
                                          pin='4679',
                                          sou='1348',
                                          honors='666')
        player.init_hand(tiles)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        tile = self._string_to_136_tile(sou='2')
        meld, _ = player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)
    def test_keep_only_yakuhai_pon(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(man='9'))
        table.add_dora_indicator(self._string_to_136_tile(man='3'))

        tiles = self._string_to_136_array(man='11144', sou='567', pin='56', honors='777')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        player.draw_tile(self._string_to_136_tile(man='4'))
        discarded_tile = player.discard_tile()
        self.assertNotEqual(self._to_string([discarded_tile]), '7z')
Пример #18
0
    def test_force_yakuhai_pair_waiting_for_tempai_hand(self):
        """
        If hand shanten = 1 don't open hand except the situation where is
        we have tempai on yakuhai tile after open set
        """
        self.table.dora_indicators.append(self._string_to_136_tile(man='3'))
        tiles = self._string_to_136_array(sou='123',
                                          pin='678',
                                          man='34468',
                                          honors='66')
        self.player.init_hand(tiles)

        # we will not get tempai on yakuhai pair with this hand, so let's skip this call
        tile = self._string_to_136_tile(man='5')
        meld, _ = self.player.try_to_call_meld(tile, False)
        self.assertEqual(meld, None)

        # but here we will have atodzuke tempai
        tile = self._string_to_136_tile(man='7')
        meld, _ = self.player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)
        self.assertEqual(meld.type, Meld.CHI)
        self.assertEqual(self._to_string(meld.tiles), '678m')

        self.table = Table()
        self.player = self.table.player

        # we can open hand in that case
        self.table.dora_indicators.append(self._string_to_136_tile(sou='5'))
        tiles = self._string_to_136_array(man='44556',
                                          sou='366789',
                                          honors='77')
        self.player.init_hand(tiles)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, self.player)
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles),
                         True)

        tile = self._string_to_136_tile(honors='7')
        meld, _ = self.player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)
        self.assertEqual(self._to_string(meld.tiles), '777z')
    def test_atodzuke_choose_hidden_syanpon(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(man='9'))

        tiles = self._string_to_136_array(man='111678', sou='56678', honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        for _ in range(0, 4):
            table.add_discarded_tile(1, self._string_to_136_tile(sou='9'), False)

        player.draw_tile(self._string_to_136_tile(man='6'))
        discarded_tile = player.discard_tile()
        self.assertNotEqual(self._to_string([discarded_tile]), '6m')
    def test_atodzuke_keep_yakuhai_wait(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(man='9'))

        tiles = self._string_to_136_array(man='11144', sou='567', pin='567', honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        # two of 4 man tiles are already out, so it would seem our wait is worse, but we know
        # we must keep two pairs in order to be atodzuke tempai
        table.add_discarded_tile(1, self._string_to_136_tile(man='4'), False)
        table.add_discarded_tile(1, self._string_to_136_tile(man='4'), False)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        player.draw_tile(self._string_to_136_tile(man='2'))
        discarded_tile = player.discard_tile()
        self.assertEqual(self._to_string([discarded_tile]), '2m')
Пример #21
0
    def test_atodzuke_choose_hidden_syanpon(self):
        # make sure yakuhai strategy is activated by adding 3 doras to the hand
        table = Table()
        player = table.player
        table.add_dora_indicator(self._string_to_136_tile(man='9'))

        tiles = self._string_to_136_array(man='111678',
                                          sou='56678',
                                          honors='77')
        player.init_hand(tiles)

        meld = self._make_meld(Meld.PON, man='111')
        player.add_called_meld(meld)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, player)
        self.assertEqual(strategy.should_activate_strategy(player.tiles), True)

        for _ in range(0, 4):
            table.add_discarded_tile(1, self._string_to_136_tile(sou='9'),
                                     False)

        player.draw_tile(self._string_to_136_tile(man='6'))
        discarded_tile = player.discard_tile()
        self.assertNotEqual(self._to_string([discarded_tile]), '6m')
    def test_force_yakuhai_pair_waiting_for_tempai_hand(self):
        """
        If hand shanten = 1 don't open hand except the situation where is
        we have tempai on yakuhai tile after open set
        """
        self.table.dora_indicators.append(self._string_to_136_tile(man='3'))
        tiles = self._string_to_136_array(sou='123', pin='678', man='34468', honors='66')
        self.player.init_hand(tiles)

        # we will not get tempai on yakuhai pair with this hand, so let's skip this call
        tile = self._string_to_136_tile(man='5')
        meld, _ = self.player.try_to_call_meld(tile, False)
        self.assertEqual(meld, None)

        # but here we will have atodzuke tempai
        tile = self._string_to_136_tile(man='7')
        meld, _ = self.player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)
        self.assertEqual(meld.type, Meld.CHI)
        self.assertEqual(self._to_string(meld.tiles), '678m')

        self.table = Table()
        self.player = self.table.player

        # we can open hand in that case
        self.table.dora_indicators.append(self._string_to_136_tile(sou='5'))
        tiles = self._string_to_136_array(man='44556', sou='366789', honors='77')
        self.player.init_hand(tiles)

        strategy = YakuhaiStrategy(BaseStrategy.YAKUHAI, self.player)
        self.assertEqual(strategy.should_activate_strategy(self.player.tiles), True)

        tile = self._string_to_136_tile(honors='7')
        meld, _ = self.player.try_to_call_meld(tile, True)
        self.assertNotEqual(meld, None)
        self.assertEqual(self._to_string(meld.tiles), '777z')