Reputation
3,804
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
8 34
Impact
~115k people reached

2h
comment Poker split / side pots
@TheodoreMurdock For sure - there can be dead chips at any of the 4 betting levels. The scenarios are hugely simplified for brevity.
4h
comment Poker split / side pots
The principle is the same whether you do it on the fly to visually display the side pots or whether you do it at the end. I did mine at the end initially and was worried I'd calculated it wrong and did it on the fly too as a sense check - exactly the same algorithm.
4h
comment Poker split / side pots
Yep, just pulled my code and it is exactly as I've described but from your answer, it seems like you've got it anyway.
4h
comment Poker split / side pots
I wouldn't get hung up on the terminology. If you find it easier to consider everything to be a side pot then fair enough.
4h
comment Poker split / side pots
That is more or less it - step 1 is initially the main pot and includes dead chips (players who have folded). Odd chips typically go to the first winner to the dealer's left.
6h
comment Poker split / side pots
I've added some bits to clarify where the side and main pots come in. Also see here for a decent description.
6h
revised Poker split / side pots
deleted 59 characters in body
7h
comment Poker split / side pots
I'll try to find my code (also C# strangely enough) and see if I can knock up some pseudo code. You basically need three bits of info: 1) Who has won 2) The dead chip count 3) The committed chips for each player.
7h
comment Poker split / side pots
@Paparazzi N.B. there are four rounds in hold 'em - pre-flop, post-flop, turn (4th street) and river (5th street).
7h
comment Poker split / side pots
@ErikEidt This sort of thing is useful for hand histories but again, not relevant for this calculation.
7h
comment Poker split / side pots
@KaspervandenBerg Whether they are all-in isn't relevant - the key thing is the committed chips for each player.
7h
comment Poker split / side pots
Sorry, I meant winner in that particular iteration. I've added another scenario to clarify.
7h
revised Poker split / side pots
added 204 characters in body
8h
comment Poker split / side pots
See paragraph in bold - I've taken out the ante bit. Are you coding a particular poker variant (e.g. seven card stud, Omaha or hold 'em etc) or are you writing your own?
8h
revised Poker split / side pots
added 119 characters in body
8h
answered Poker split / side pots
9h
comment Is 'pirate version' standard jargon for unreleased builds in the computing industry?
AFAIK, this is more commonly known as an alpha release
9h
comment What are the problems with boolean variables?
@jdl134679 Yep, "let's introduce the problems of reference types to value types..."
9h
comment What are the problems with boolean variables?
@microtherion I was making the point that it is foolhardy to compare the languages of yesteryear to the demands of today's programmers. And C was never "missing" a boolean type - it simply wasn't required due to the design of the language. If you did want it, you could implement it in one line. C99 has it as standard too.
11h
revised What are the problems with boolean variables?
added 20 characters in body