Hand.py: Use sum(x) instead of reduce(operator.add, x, 0)
From: Scott Wolchok <scott@wolchok.org> Make the code slightly more readable
This commit is contained in:
parent
f6351cef53
commit
f006b7c253
|
@ -490,7 +490,7 @@ For sites (currently only Carbon Poker) which record "all in" as a special actio
|
||||||
amount = amount.replace(u',', u'') #some sites have commas
|
amount = amount.replace(u',', u'') #some sites have commas
|
||||||
Ai = Decimal(amount)
|
Ai = Decimal(amount)
|
||||||
Bp = self.lastBet[street]
|
Bp = self.lastBet[street]
|
||||||
Bc = reduce(operator.add, self.bets[street][player], 0)
|
Bc = sum(self.bets[street][player])
|
||||||
C = Bp - Bc
|
C = Bp - Bc
|
||||||
if Ai <= C:
|
if Ai <= C:
|
||||||
self.addCall(street, player, amount)
|
self.addCall(street, player, amount)
|
||||||
|
@ -592,7 +592,7 @@ Add a raise by amountBy on [street] by [player]
|
||||||
self.checkPlayerExists(player)
|
self.checkPlayerExists(player)
|
||||||
Rb = Decimal(amountBy)
|
Rb = Decimal(amountBy)
|
||||||
Bp = self.lastBet[street]
|
Bp = self.lastBet[street]
|
||||||
Bc = reduce(operator.add, self.bets[street][player], 0)
|
Bc = sum(self.bets[street][player])
|
||||||
C = Bp - Bc
|
C = Bp - Bc
|
||||||
Rt = Bp + Rb
|
Rt = Bp + Rb
|
||||||
|
|
||||||
|
@ -609,7 +609,7 @@ For sites which by "raises x" mean "calls and raises putting a total of x in the
|
||||||
amount = amount.replace(u',', u'') #some sites have commas
|
amount = amount.replace(u',', u'') #some sites have commas
|
||||||
CRb = Decimal(amount)
|
CRb = Decimal(amount)
|
||||||
Bp = self.lastBet[street]
|
Bp = self.lastBet[street]
|
||||||
Bc = reduce(operator.add, self.bets[street][player], 0)
|
Bc = sum(self.bets[street][player])
|
||||||
C = Bp - Bc
|
C = Bp - Bc
|
||||||
Rb = CRb - C
|
Rb = CRb - C
|
||||||
Rt = Bp + Rb
|
Rt = Bp + Rb
|
||||||
|
@ -624,7 +624,7 @@ Add a raise on [street] by [player] to [amountTo]
|
||||||
self.checkPlayerExists(player)
|
self.checkPlayerExists(player)
|
||||||
amountTo = amountTo.replace(u',', u'') #some sites have commas
|
amountTo = amountTo.replace(u',', u'') #some sites have commas
|
||||||
Bp = self.lastBet[street]
|
Bp = self.lastBet[street]
|
||||||
Bc = reduce(operator.add, self.bets[street][player], 0)
|
Bc = sum(self.bets[street][player])
|
||||||
Rt = Decimal(amountTo)
|
Rt = Decimal(amountTo)
|
||||||
C = Bp - Bc
|
C = Bp - Bc
|
||||||
Rb = Rt - C - Bc
|
Rb = Rt - C - Bc
|
||||||
|
@ -1386,7 +1386,7 @@ Add a complete on [street] by [player] to [amountTo]
|
||||||
amountTo = amountTo.replace(u',', u'') #some sites have commas
|
amountTo = amountTo.replace(u',', u'') #some sites have commas
|
||||||
self.checkPlayerExists(player)
|
self.checkPlayerExists(player)
|
||||||
Bp = self.lastBet['THIRD']
|
Bp = self.lastBet['THIRD']
|
||||||
Bc = reduce(operator.add, self.bets[street][player], 0)
|
Bc = sum(self.bets[street][player])
|
||||||
Rt = Decimal(amountTo)
|
Rt = Decimal(amountTo)
|
||||||
C = Bp - Bc
|
C = Bp - Bc
|
||||||
Rb = Rt - C
|
Rb = Rt - C
|
||||||
|
|
Loading…
Reference in New Issue
Block a user