# All-in rules in extreme cases

I'm planning to try some poker bot programming in NLH, so I must know all the rules. I got almost all covered, but some all-in situations are not very clear to me. So I ask:

For all questions, BB=100

1. Say we have players 1 to 4 in order with stacks 50, 1000, 3000, 9000. Player 1 decides to bet: he goes all in 50. Now, what can player 2 do? I think all remaining players can only fold or call 50 because there is no full bet, so no one can raise. Is this correct?

2. Say a player bets 200, and the next player has exactly 200 in his stack and wants to call. Is he 'all-in'? Do I need to create side pots here? Suppose all other players have more than 200 and they either call or fold.

In my program, for every betting round, I'm tracking the following variables:

1. SB, BB value and stack sizes.
2. Full bet made (true or false).
3. Full bet value in case full bet was made.
4. Full raise made (true or false).
5. Minimum raise, starting value is BB and is updated when someone bets or does a full raise.
6. Current 'call' value, i.e. how much the current player needs to match to just call.

Is there some general rule/algorithm involving these variables? Or do I need to look at extreme cases?

Thanks!

1. No. Player 2 can either call by putting in 100 to match the big blind here, or he can raise to any amount 200 (100 big blind + 100) or more. Then players 3 and 4 will have their right to act, during which they can each opt to call, raise, or fold when the action is on them. A player going all-in for less than the blind doesn't eliminate those players' right to act on their hand.

2. If the player calls the 200 and has no remaining chips in his stack, then he is indeed "all in." Assuming no other player is already all in on this hand, 200 chips from all callers on this street will be placed in the main pot and that main pot. Side pots will be created when any additional bets or raises are made. The all in player will not be eligible for any of the side pots.

It's not really clear to me what you're trying to do in your software, but I think you'd benefit from reading some basic explanations of legal bets and raises and how side pots are dealt with. I wouldn't consider these particularly extreme cases, since you'll see side pots created at most games without having to sit for very long. There are quite a few questions here in the "related questions" sidebar that will point you to more details for each topic.

If you want to post a new question here for each more specific concern you have, that might work out best, and you'll probably be able to get some good helpful explanations.

1. No, no. The "current bet amount" is 100, the big blind. Each player in turn facing that must call 100 if he can, go all in short if he can't, or raise. The fact that a player went all in short ahead of you does not in any way affect your options. For the next player it's 100 to call, or 200 or more to raise.

2. If a player goes all-in for an exact call, then yes, he's all-in. But there's no side pot until someone else makes further action.

The algorithm for settling bets is very detailed, but it's basically this: each player can win only the total money he put into the pot, plus that same amount from each of the other players, and he can only win that if he is in first place among all players with that same amount in the pot.

In a cardroom, side pots are paid outside-in because that's easier for the dealers. But a computer should probably do it inside-out: (1) find the best remaining hand, (2) award that player the money he has bet, plus that same amount from each of the the other players. If any of those other players had bet exactly that amount or less, they are eliminated. The player you just paid is also eliminated. If any players remain, return to step 1.

• So a 'underbet' does not lower the 'call' value for the next player. What if it was an 'under raise', for ex.: instead of 50, player 1 bets 250...player 2 call value is now 250 or still 200? Thanks! Jul 14, 2015 at 23:05
• A short raise is similar...it's treated logically as a call, but the extra money still has to be matched. So, for example, the first player goes all-in for 110. Player two may now call (for 110), make the FIRST raise to 200 or more (the 110 didn't count as a raise, so the first raise is 100 + 100), or fold. Note also: player 1 raises to 200; player 3 goes all in for 250; player 3 calls 250. Now player 1 must put in the extra 50 to continue, but since it was not a complete raise, he MAY NOT reraise. Jul 14, 2015 at 23:14