# All-ins and folds: what happens to folded money?

I am trying to write a small, but complex, Texas Hold 'Em game in C++. I've come very close to the end. I'm at the part of determining winners, and payouts. Suffice it to say, I underestimated the complexity of poker.

At any rate, to finish my game, I need to understand a few things. First, observe the following hand starting chip stacks (ignoring forced bets for simplicity):

Player 1: 4k
Player 2: 6k
Player 3: 8k
Player 4: 10k

Say the hand gets to the showdown looking like this:

Player 1: all-in (for 4k)
Player 2: all-in (for 6k)
Player 3: folded after initially calling for 4k
Player 4: called 6k

Now, here is where it gets fuzzy: What would the primary pot look like? Since p3 folded, I am assuming it would be 3 * 4k, while the sidepot contested by p2 and p4 would be 2* 2k.

But what happens to the folded guy (p3)'s money? Is it added to the primary pot? Split equally between all pots? Returned?

• If p3 put 4k into the pot, that's in the main pot: it's 4 x 4k. It has four players' money in it, even though only three of them are now eligible to win it. You are correct about pot 2: it contains 2k from p2 and 2k from p4, and only they can win it. Dec 10, 2015 at 17:01