Rummy card combination algorithm
Rummy game altogether is composed of 2 poker card 108
Ace is a fixed yoriko
Game start will choose a brand value as yoriko
3 combination
Pure sequence: flush
Sequence: flush of lai
Collection: different design and color is the same brand value of three or four, available yoriko
The game conditions:
Meet a pure sequences, and more than a sequence, a pure sequence can be used to meet the requirement of sequence
Write such an algorithm function
The function fuc (card_list, joker)
Return group_list
Parameter
Card_list: hand
Joker: yoriko card
The return value:
Group_list
The optimal results
One_group={
Type=1, type of pure sequence sequence or set or void deck
Card_list=group brand list
}