Skip to main content
Question Protected by gnat
Tweeted twitter.com/StackSoftEng/status/862647944675291136
edited body
Source Link
paparazzo
  • 1.9k
  • 1
  • 14
  • 23

I am writing a poker application and trying to figure out how to deal with split pots and side pots

There are three roundfour rounds of betting and each round of betting can have multiple orbits

Can only bet the chips in front of you
So if a player is all in a side pot is created

Hands can tie - in which case the pot is split
If it does not spit evenly the 'last aggressor (raise)' gets the odd chip(s)

If you are raised you must call or fold
If you fold you lose your bets even if the hand wins
You cannot just cap you betting and create a side pot
You only create a side pot if you are all in

PlayerA all in 40 Win
PlayerB 80 second
PlayerC 80 last

Player A would take 120 (win 80 as 40 was his money in)
Player B would take 80

But you don't know the win order until the end
And when PlayerA went in you don't know how many people are going to call

What could be good algorithm for this?

This code is C# but really just looking for an approach.

My initial thought is to just record all the betting for each player
street, orbit, bet

Where that gets messy is that in a single orbit you could have multiple players all in for different amounts (bet)

And a different amount is not just all in
Player could be raised and then fold
In that case you know they lose but you still don't know who they lose to

There are rarely more than 3 orbits in a round
You could assume there would never be more than 10 as with min raise players would run out of chip

I am writing a poker application and trying to figure out how to deal with split pots and side pots

There are three round of betting and each round of betting can have multiple orbits

Can only bet the chips in front of you
So if a player is all in a side pot is created

Hands can tie - in which case the pot is split
If it does not spit evenly the 'last aggressor (raise)' gets the odd chip(s)

If you are raised you must call or fold
If you fold you lose your bets even if the hand wins
You cannot just cap you betting and create a side pot
You only create a side pot if you are all in

PlayerA all in 40 Win
PlayerB 80 second
PlayerC 80 last

Player A would take 120 (win 80 as 40 was his money in)
Player B would take 80

But you don't know the win order until the end
And when PlayerA went in you don't know how many people are going to call

What could be good algorithm for this?

This code is C# but really just looking for an approach.

My initial thought is to just record all the betting for each player
street, orbit, bet

Where that gets messy is that in a single orbit you could have multiple players all in for different amounts (bet)

And a different amount is not just all in
Player could be raised and then fold
In that case you know they lose but you still don't know who they lose to

There are rarely more than 3 orbits in a round
You could assume there would never be more than 10 as with min raise players would run out of chip

I am writing a poker application and trying to figure out how to deal with split pots and side pots

There are four rounds of betting and each round of betting can have multiple orbits

Can only bet the chips in front of you
So if a player is all in a side pot is created

Hands can tie - in which case the pot is split
If it does not spit evenly the 'last aggressor (raise)' gets the odd chip(s)

If you are raised you must call or fold
If you fold you lose your bets even if the hand wins
You cannot just cap you betting and create a side pot
You only create a side pot if you are all in

PlayerA all in 40 Win
PlayerB 80 second
PlayerC 80 last

Player A would take 120 (win 80 as 40 was his money in)
Player B would take 80

But you don't know the win order until the end
And when PlayerA went in you don't know how many people are going to call

What could be good algorithm for this?

This code is C# but really just looking for an approach.

My initial thought is to just record all the betting for each player
street, orbit, bet

Where that gets messy is that in a single orbit you could have multiple players all in for different amounts (bet)

And a different amount is not just all in
Player could be raised and then fold
In that case you know they lose but you still don't know who they lose to

There are rarely more than 3 orbits in a round
You could assume there would never be more than 10 as with min raise players would run out of chip

added 162 characters in body
Source Link
paparazzo
  • 1.9k
  • 1
  • 14
  • 23

I am writing a poker application and trying to figure out how to deal with split pots and side pots

There are three round of betting and each round of betting can have multiple orbits

Can only bet the chips in front of you
So if a player is all in a side pot is created

Hands can tie - in which case the pot is split
If it does not spit evenly the 'last aggressor (raise)' gets the odd chip(s)

A hand canIf you are raised you must call or fold and that is
If you fold you lose your bets even if the hand wins
You cannot just treated likecap you betting and create a losing handside pot
You only create a side pot if you are all in

PlayerA all in 40 Win
PlayerB 80 second
PlayerC 80 last

Player A would take 120 (win 80 as 40 was his money in)
Player B would take 80

But you don't know the win order until the end
And when PlayerA went in you don't know how many people are going to call

What could be good algorithm for this?

This code is C# but really just looking for an approach.

My initial thought is to just record all the betting for each player
street, orbit, bet

Where that gets messy is that in a single orbit you could have multiple players all in for different amounts (bet)

And a different amount is not just all in
Player could be raised and then fold
In that case you know they lose but you still don't know who they lose to

There are rarely more than 3 orbits in a round
You could assume there would never be more than 10 as with min raise players would run out of chip

I am writing a poker application and trying to figure out how to deal with split pots

There are three round of betting and each round of betting can have multiple orbits

Can only bet the chips in front of you
So if a player is all in a side pot is created

Hands can tie - in which case the pot is split
If it does not spit evenly the 'last aggressor (raise)' gets the odd chip(s)

A hand can fold and that is just treated like a losing hand

PlayerA all in 40 Win
PlayerB 80 second
PlayerC 80 last

Player A would take 120 (win 80 as 40 was his money in)
Player B would take 80

But you don't know the order until the end
And when PlayerA went in you don't know how many people are going to call

What could be good algorithm for this?

This code is C# but really just looking for an approach.

My initial thought is to just record all the betting for each player
street, orbit, bet

Where that gets messy is that in a single orbit you could have multiple players all in for different amounts (bet)

And a different amount is not just all in
Player could be raised and then fold
In that case you know they lose but you still don't know who they lose to

There are rarely more than 3 orbits in a round
You could assume there would never be more than 10 as with min raise players would run out of chip

I am writing a poker application and trying to figure out how to deal with split pots and side pots

There are three round of betting and each round of betting can have multiple orbits

Can only bet the chips in front of you
So if a player is all in a side pot is created

Hands can tie - in which case the pot is split
If it does not spit evenly the 'last aggressor (raise)' gets the odd chip(s)

If you are raised you must call or fold
If you fold you lose your bets even if the hand wins
You cannot just cap you betting and create a side pot
You only create a side pot if you are all in

PlayerA all in 40 Win
PlayerB 80 second
PlayerC 80 last

Player A would take 120 (win 80 as 40 was his money in)
Player B would take 80

But you don't know the win order until the end
And when PlayerA went in you don't know how many people are going to call

What could be good algorithm for this?

This code is C# but really just looking for an approach.

My initial thought is to just record all the betting for each player
street, orbit, bet

Where that gets messy is that in a single orbit you could have multiple players all in for different amounts (bet)

And a different amount is not just all in
Player could be raised and then fold
In that case you know they lose but you still don't know who they lose to

There are rarely more than 3 orbits in a round
You could assume there would never be more than 10 as with min raise players would run out of chip

added 220 characters in body
Source Link
paparazzo
  • 1.9k
  • 1
  • 14
  • 23

I am writing a poker application and trying to figure out how to deal with split pots

There are three round of betting and each round of betting can have multiple orbits

Can only bet the chips in front of you
So if a player is all in a side pot is created

Hands can tie - in which case the pot is split
If it does not spit evenly the 'last aggressor (raise)' gets the odd chip(s)

A hand can fold and that is just treated like a losing hand

PlayerA all in 40 Win
PlayerB 80 second
PlayerC 80 last

Player A would take 120 (win 80 as 40 was his money in)
Player B would take 80

But you don't know the order until the end
And when PlayerA went in you don't know how many people are going to call

What could be good algorithm for this?

This code is C# but really just looking for an approach.

My initial thought is to just record all the betting for each player
street, orbit, bet

Where that gets messy is that in a single orbit you could have multiple players all in for different amounts (bet)

And a different amount is not just all in
Player could be raised and then fold
In that case you know they lose but you still don't know who they lose to

There are rarely more than 3 orbitorbits in a round
You could assume there would never be more than 10 as with min raise players would run out of chip

I am writing a poker application and trying to figure out how to deal with split pots

There are three round of betting and each round of betting can have multiple orbits

Can only bet the chips in front of you
So if a player is all in a side pot is created

Hands can tie - in which case the pot is split

A hand can fold and that is just treated like a losing hand

PlayerA all in 40 Win
PlayerB 80 second
PlayerC 80 last

Player A would take 120 (win 80 as 40 was his money in)
Player B would take 80

But you don't know the order until the end
And when PlayerA went in you don't know how many people are going to call

What could be good algorithm for this?

This code is C# but really just looking for an approach.

My initial thought is to just record all the betting for each player
street, orbit, bet

Where that gets messy is that in a single orbit you could have multiple players all in for different amounts (bet)

There are rarely more than 3 orbit in a round
You could assume there would never be more than 10 as with min raise players would run out of chip

I am writing a poker application and trying to figure out how to deal with split pots

There are three round of betting and each round of betting can have multiple orbits

Can only bet the chips in front of you
So if a player is all in a side pot is created

Hands can tie - in which case the pot is split
If it does not spit evenly the 'last aggressor (raise)' gets the odd chip(s)

A hand can fold and that is just treated like a losing hand

PlayerA all in 40 Win
PlayerB 80 second
PlayerC 80 last

Player A would take 120 (win 80 as 40 was his money in)
Player B would take 80

But you don't know the order until the end
And when PlayerA went in you don't know how many people are going to call

What could be good algorithm for this?

This code is C# but really just looking for an approach.

My initial thought is to just record all the betting for each player
street, orbit, bet

Where that gets messy is that in a single orbit you could have multiple players all in for different amounts (bet)

And a different amount is not just all in
Player could be raised and then fold
In that case you know they lose but you still don't know who they lose to

There are rarely more than 3 orbits in a round
You could assume there would never be more than 10 as with min raise players would run out of chip

added 220 characters in body
Source Link
paparazzo
  • 1.9k
  • 1
  • 14
  • 23
Loading
added 220 characters in body
Source Link
paparazzo
  • 1.9k
  • 1
  • 14
  • 23
Loading
added 64 characters in body
Source Link
paparazzo
  • 1.9k
  • 1
  • 14
  • 23
Loading
Source Link
paparazzo
  • 1.9k
  • 1
  • 14
  • 23
Loading