# coding=UTF-8
'''
In the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the following way:
1•High Card: Highest value card.
2•One Pair: Two cards of the same value.
3•Two Pairs: Two different pairs.
4•Three of a Kind: Three cards of the same value.
5•Straight: All cards are consecutive values.
6•Flush: All cards of the same suit.
7•Full House: Three of a kind and a pair.
8•Four of a Kind: Four cards of the same value.
9•Straight Flush: All cards are consecutive values of same suit.
10•Royal Flush: Ten, Jack, Queen, King, Ace, in same suit.
The cards are valued in the order:
2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace.
'''
class TypeCard:
def __init__(self,rank):
self.rank = rank
def __gt__(self,other):
return self.rank > other.rank
def __lt__(self,other):
return not self.__gt__(other)
def __eq__(self,other):
return self.rank == other.rank
def __str__(self):
return str(self.rank)
class Card:
def __init__(self,value,color):
self.value = value
self.color = color
def __str__(self):
return str(self.value) + " " + self.color + " "
class Hand:
def __init__(self,cards):
self.cards = cards
def __str__(self):
ret = ""
for card in self.cards:
ret += card.__str__()
return ret
def __gt__(self,other):
t1 = self.what_rank()
print t1
t2 = other.what_rank()
print t2
if t1 > t2:
return True
if t1 < t2:
return False
if t1.value == 9: