# What's this difference in the pot?

I am trying to keep track of the pot for my calculations but there is a tiny difference I can't see that happens in 2% of the hands, can you help me to spot it?

here I add a simple example:

`````` pot 0 maxraise 0 Table 'Asterion IV' 9-max (Play Money) Seat #2 is the button
pot 0 maxraise 0 Seat 1: Sever314 (1000 in chips)
pot 0 maxraise 0 Seat 2: .canche900 (9642 in chips)
pot 0 maxraise 0 Seat 3: Dimusik1978 (1631 in chips)
pot 0 maxraise 0 Seat 4: HSPaulo (614 in chips)
pot 0 maxraise 0 Seat 5: Adorno1961 (742 in chips)
pot 0 maxraise 0 Seat 6: Gaston4315 (2530 in chips)
pot 0 maxraise 0 Seat 7: dan321em (880 in chips)
pot 0 maxraise 0 Seat 8: meckenheim (786 in chips)
pot 0 maxraise 0 Seat 9: fresa (3006 in chips)
pot 5 maxraise 5 Dimusik1978: posts small blind 5
pot 15 maxraise 10 HSPaulo: posts big blind 10
pot 20 maxraise 10 Sever314: posts small blind 5
pot 20 maxraise 10 *** HOLE CARDS ***
pot 30 maxraise 10 Adorno1961: calls 10
pot 40 maxraise 10 Gaston4315: calls 10
pot 50 maxraise 10 dan321em: calls 10
pot 60 maxraise 10 meckenheim: calls 10
pot 70 maxraise 10 fresa: calls 10
pot 1060 maxraise 995 Sever314: raises 985 to 995 and is all-in
pot 2055 maxraise 995 .canche900: calls 995
pot 3045 maxraise 995 Dimusik1978: calls 990
pot 3649 maxraise 995 HSPaulo: calls 604 and is all-in
pot 4381 maxraise 995 Adorno1961: calls 732 and is all-in
pot 4381 maxraise 995 Gaston4315: folds
pot 4381 maxraise 995 dan321em: folds
pot 4381 maxraise 995 meckenheim: folds
pot 4381 maxraise 995 fresa: folds
pot 4381 maxraise 0 *** FLOP *** [Ac 9h Ks]
pot 5017 maxraise 636 Dimusik1978: bets 636 and is all-in
pot 5653 maxraise 636 .canche900: calls 636
pot 5653 maxraise 0 *** TURN *** [Ac 9h Ks] [Qs]
pot 5653 maxraise 0 *** RIVER *** [Ac 9h Ks Qs] [3c]
pot 5653 maxraise 0 *** SHOW DOWN ***
pot 5653 maxraise 0 Dimusik1978: shows [Kc Qd] (two pair, Kings and Queens)
pot 5653 maxraise 0 .canche900: shows [7d As] (a pair of Aces)
pot 5653 maxraise 0 Dimusik1978 collected 1272 from side pot-3
pot 5653 maxraise 0 Sever314: shows [Jc 6h] (high card Ace)
pot 5653 maxraise 0 Dimusik1978 collected 759 from side pot-2
pot 5653 maxraise 0 Adorno1961: shows [Qc 8d] (a pair of Queens)
pot 5653 maxraise 0 Dimusik1978 collected 502 from side pot-1
pot 5653 maxraise 0 HSPaulo: shows [Ah 9s] (two pair, Aces and Nines)
pot 5653 maxraise 0 HSPaulo collected 2975 from main pot
pot 5653 maxraise 0 *** SUMMARY ***
(dataformat.cpp:101) POT 5653 should be 5658!!!
``````

I add the calls directly to the pot and I sum the raises with the difference to their previous call, the current process to track the pot is something like this:

``````//if posts: num>maxraise?maxraise=num, player.lastcall=num, pot+=num
//Thanks Herb Wolfe for spotting this error (ante should not be considered as lastcall)
if ante: pot+=num
if blind: num>maxraise?maxraise=num, player.lastcall=num, pot+=num
if calls: pot+=num, player.lastcall=maxraise
if bets: pot+=num, maxraise=num, player.lastcall=maxraise
if raises: pot+=num1+(maxraise-player.lastcall), maxraise=num2, player.lastcall=maxraise
if uncalled bet: pot-=num
``````

Here is another example:

`````` pot 0 maxraise 0 Table 'Conrada III' 9-max (Play Money) Seat #4 is the button
pot 0 maxraise 0 Seat 3: Male0808 (7347 in chips)
pot 0 maxraise 0 Seat 4: McMuddy (5170 in chips)
pot 0 maxraise 0 Seat 5: boo9365 (4659 in chips)
pot 0 maxraise 0 Seat 6: SAD-IORIO (4988 in chips)
pot 0 maxraise 0 Seat 7: dan321em (1986 in chips)
pot 5 maxraise 5 boo9365: posts small blind 5
pot 15 maxraise 10 SAD-IORIO: posts big blind 10
pot 30 maxraise 15 dan321em: posts small & big blinds 15
pot 32 maxraise 15 Male0808: posts the ante 2
pot 34 maxraise 15 McMuddy: posts the ante 2
pot 36 maxraise 15 boo9365: posts the ante 2
pot 38 maxraise 15 SAD-IORIO: posts the ante 2
pot 40 maxraise 15 dan321em: posts the ante 2
pot 40 maxraise 15 *** HOLE CARDS ***
pot 40 maxraise 15 dan321em: checks
pot 50 maxraise 15 Male0808: calls 10
pot 105 maxraise 50 McMuddy: raises 40 to 50
pot 105 maxraise 50 boo9365: folds
pot 145 maxraise 50 SAD-IORIO: calls 40
pot 185 maxraise 50 dan321em: calls 40
pot 225 maxraise 50 Male0808: calls 40
pot 225 maxraise 0 *** FLOP *** [9c Qd Kd]
pot 225 maxraise 0 SAD-IORIO: checks
pot 225 maxraise 0 dan321em: checks
pot 375 maxraise 150 Male0808: bets 150
pot 525 maxraise 150 McMuddy: calls 150
pot 675 maxraise 150 SAD-IORIO: calls 150
pot 675 maxraise 150 dan321em: folds
pot 675 maxraise 0 *** TURN *** [9c Qd Kd] [Th]
pot 995 maxraise 320 SAD-IORIO: bets 320
pot 2635 maxraise 1640 Male0808: raises 1320 to 1640
pot 2635 maxraise 1640 McMuddy: folds
pot 3955 maxraise 1640 SAD-IORIO: calls 1320
pot 3955 maxraise 0 *** RIVER *** [9c Qd Kd Th] [8s]
pot 3955 maxraise 0 SAD-IORIO: checks
pot 7155 maxraise 3200 Male0808: bets 3200
pot 10301 maxraise 3200 SAD-IORIO: calls 3146 and is all-in
pot 10247 maxraise 3200 Uncalled bet (54) returned to Male0808
pot 10247 maxraise 3200 *** SHOW DOWN ***
pot 10247 maxraise 3200 Male0808: shows [Kh Js] (a straight, Nine to King)
pot 10247 maxraise 3200 SAD-IORIO: shows [8d Jd] (a straight, Nine to King)
pot 10247 maxraise 3200 SAD-IORIO collected 5046 from pot
pot 10247 maxraise 3200 Male0808 collected 5046 from pot
pot 10247 maxraise 3200 *** SUMMARY ***
(dataformat.cpp:101) POT 10247 should be 10242!!!
``````

EDIT I changed the examples to reflect the missing errors

• The pot totals don't look correct after the raises. Are you sure your formulas are correct? – Herb Mar 13 '16 at 2:43
• pot 31 maxraise 10 isidore1970: calls 10 pot 79 maxraise 50 Male0808: raises 40 to 50 <-- Here, the post should be 76. small blind calls 5 to make it 36, then raises 40 to make it 76. – Herb Mar 13 '16 at 3:17
• @HerbWolfe I am not sure I made it myself but this is the one that have worked better, the difference is some number close to the small and big bets. Still I'm not sure what's left that I am missing. – shuji Mar 13 '16 at 3:17
• pot 190 maxraise 40 paparick13: folds pot 450 maxraise 270 incanto-111: raises 230 to 270 <-- This should be 460. call of 40 to make the pot 230, then the raise of 230 makes it 460. – Herb Mar 13 '16 at 3:18
• @HerbWolfe You are right about that, I was taking the ante as their previous call. – shuji Mar 13 '16 at 3:51

In the first example, I think something is off when

``````pot 1060 maxraise 995 Sever314: raises 985 to 995 and is all-in
``````

because Sever314 started the hand with 1000 in chips (and posted 5 as an out of order small blind).

In the second example, dan321em's call here:

`````` pot 105 maxraise 50 McMuddy: raises 40 to 50
pot 105 maxraise 50 boo9365: folds
pot 145 maxraise 50 SAD-IORIO: calls 40
pot 185 maxraise 50 dan321em: calls 40
``````

should only be 35 since he posted a small and big blind total of 15 out of order.

• Thanks a lot, in the first example I think it's an error in the file, it should have been logged as he posted small and big blind. as for the second example nobody is trying to call the small & big blind sum so I will not assign it to maxraise or player.lastcall. – shuji Mar 14 '16 at 17:47