Ejemplo n.º 1
0
def FindAllCardsCombination(Cardlist=[]):
    temp_Cardlist = list.copy(Cardlist)
    AllCardsCombination = []
    temp_list = []
    temp_list = CommonCardsType.FindTonghuashun(temp_Cardlist)
    if (temp_list != []):
        for item in temp_list:
            AllCardsCombination.append(item)
    temp_list = CommonCardsType.FindZhadan(temp_Cardlist)
    if (temp_list != []):
        for item in temp_list:
            AllCardsCombination.append(item)
    temp_list = CommonCardsType.FindHulu(temp_Cardlist)
    if (temp_list != []):
        for item in temp_list:
            AllCardsCombination.append(item)
    temp_list = CommonCardsType.FindTonghua(temp_Cardlist)
    if (temp_list != []):
        for item in temp_list:
            AllCardsCombination.append(item)
    temp_list = CommonCardsType.FindShunzi(temp_Cardlist)
    if (temp_list != []):
        for item in temp_list:
            AllCardsCombination.append(item)
    temp_list = CommonCardsType.FindSantiao(temp_Cardlist)
    if (temp_list != []):
        for item in temp_list:
            AllCardsCombination.append(item)
    temp_list = CommonCardsType.FindLiandui(temp_Cardlist)
    if (temp_list != []):
        for item in temp_list:
            AllCardsCombination.append(item)
    temp_list = CommonCardsType.FindErdui(temp_Cardlist)
    if (temp_list != []):
        for item in temp_list:
            AllCardsCombination.append(item)
    temp_list = CommonCardsType.FindDuizi(temp_Cardlist)
    if (temp_list != []):
        for item in temp_list:
            AllCardsCombination.append(item)
    return AllCardsCombination
Ejemplo n.º 2
0
def Judge(Cardlist=[]):
    temp_Cardlist = list.copy(Cardlist)
    if (CommonCardsType.FindTonghuashun(temp_Cardlist) != []):
        return 9
    elif (CommonCardsType.FindZhadan(temp_Cardlist) != []):
        return 8
    elif (CommonCardsType.FindHulu(temp_Cardlist) != []):
        return 7
    elif (CommonCardsType.FindTonghua(temp_Cardlist) != []):
        return 6
    elif (CommonCardsType.FindShunzi(temp_Cardlist) != []):
        return 5
    elif (CommonCardsType.FindSantiao(temp_Cardlist) != []):
        return 4
    elif (CommonCardsType.FindLiandui(temp_Cardlist) != []):
        return 3
    elif (CommonCardsType.FindErdui(temp_Cardlist) != []):
        return 2
    elif (CommonCardsType.FindDuizi(temp_Cardlist) != []):
        return 1
    else:
        return 0