xxrobboxx / opentestbed

Automatically exported from code.google.com/p/opentestbed
0 stars 0 forks source link

Add proper (SidePot)-Handling #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Currently we don't handle side-pots correctly.

When a player can't call the needed amount for the current pot, the topmost
(side)pot needs to be splitted, and already paid money from other players
transferred to this new sidepot.
Subsequent players need to fill up all sidepots they didn't commit to yet,
I guess for this each sidepots needs to track its own upper bound.

Consider ugly cases:
player 1 raise 100:
mainPot=100
player 2 call 50:
mainPot(player1+2)=50+50, sidepot1(player1)=50
player 3 call 75:
mainPot(player1+2+3)=50+50+50, sidepot1(player1+3)=25+25, sidepot2(player1)=25
player 4 call 20:
mainPot(player1+2+3+4)=20+20+20+20, sidePot1=(player1+2+3)=30+30+30,
sidepot2(player1+3)=25+25, sidepot3(player1)=25

Sidepot order needs to be created like this example to not disturb the
current showdown logic (which starts to payout all pots in reverse order)

Original issue reported on code.google.com by bluegasp...@gmail.com on 27 Mar 2010 at 12:01

GoogleCodeExporter commented 8 years ago
I'm stuck not having proper side-pot handling, so am afraid I have to start 
here.
Wished to see some more activity from others ..

Original comment by bluegasp...@gmail.com on 2 Apr 2010 at 2:32

GoogleCodeExporter commented 8 years ago
no errors found anymore

Original comment by bluegasp...@gmail.com on 4 Apr 2010 at 8:49