Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- b=sorted
- def q(y,s):
- y=b("23456789TJQKA".index(x)for x in y)[::-1]
- f={x:y.count(x)for x in y}
- v=b((f[x],x)for x in f)[::-1]
- (a,A),(x,X)=v[:2]
- F=len(set(s))<2
- W=A>12and X<4
- S=a<2and(A<v[4][1]+5or W)
- o=a+x-(a<3),v
- if S*W:y=1
- if S+F:o=5+F,y
- if a+x>4:o=4+a,v
- if S*F:o=9,y
- return o
- print sum(q(L[:15:3],L[1:15:3])>q(L[15:30:3],L[16:30:3])for L in file('poker.txt'))
Add Comment
Please, Sign In to add comment