Sep-02-2021, 10:59 PM
Hello, i have this small program:
Can someone help?
hand = [['7','h'],['5','h']] flop = [] turn = [] river = [] table = [['13','H'],['10', 'h'],['12','h'],['11','h'],['9','h']] playershand = hand + table pairinhand = False a = 0 b = 0 c = 0 d = 0 e = 0 f = 0 g = 0 possiblesuite=False suite = False playersgrade = [] def checksuiteinplayershand(playershand, possiblesuite): suite = playershand suite.sort() a=int(suite[0][0]) b=int(suite[1][0]) c=int(suite[2][0]) d=int(suite[3][0]) e=int(suite[4][0]) f=int(suite[5][0]) g=int(suite[6][0]) if a!=b and a!=c and a!=d and a!=g: if a+5>b>a and a+5>c>a and a+5>d>a and a+5>e>a: possiblesuite=True return possiblesuite, g if b!=c and b!=d and b!=e and b!=f: if b+5>c>b and b+5>d>b and b+5>e>b and b+5>f>b: possiblesuite=True return possiblesuite, f if c!=d and c!=e and c!=f and c!=g: if c+5>d>c and c+5>e>c and c+5>f>c and c+5>g>c: possiblesuite=True return possiblesuite, g if a==1: a=14 if g!=f and f!=e and e!=d: if g>a-5 and f>a-5 and e>a-5 and d>a-5: possiblesuite=True return possiblesuite, a if g==f and f!=e and e!=d and d!=c: if f>a-5 and e>a-5 and d>a-5 and c>a-5: possiblesuite=True return possiblesuite, a if g==f and f==e and e!=d and d!=c and c!=b: if d>e-5 and c>e-5 and b>e-5: possiblesuite=True return possiblesuite, a print(hand) print(table) print(playershand) print('checksuiteinplayershand: ', end=' ') print(checksuiteinplayershand(playershand, possiblesuite))
Output:[['7', 'h'], ['5', 'h']]
[['13', 'H'], ['10', 'h'], ['12', 'h'], ['11', 'h'], ['9', 'h']]
[['7', 'h'], ['5', 'h'], ['13', 'H'], ['10', 'h'], ['12', 'h'], ['11', 'h'], ['9', 'h']]
checksuiteinplayershand: None
I was expectingOutput:checksuiteinplayershand: (True, 13)
I've been trying to figure it out for hours now, but to no avail. I mean if it returns 'None' it means the list is empty, but it's not because when i do print(playershand) i get [['7', 'h'], ['5', 'h'], ['13', 'H'], ['10', 'h'], ['12', 'h'], ['11', 'h'], ['9', 'h']] so how can i get 'None' for answer???Can someone help?