openpoker icon indicating copy to clipboard operation
openpoker copied to clipboard

Negative pot issue

Open bayasaa opened this issue 4 years ago • 0 comments

Please refer the following scenario. After this scenario, we end up having a negative pot which we are unable to split between the players.

all_in_example14_test() -> Pot = new(), { Pot1, 0 } = add_bet(Pot, 'A', 5), { Pot2, 0 } = add_bet(Pot1, 'B', 5), { Pot3, 0 } = add_bet(Pot2, 'C', 100), { Pot4, 0 } = add_bet(Pot3, 'A', 5, true), { Pot5, 0 } = add_bet(Pot4, 'B', 1, true), Side1 = lists:nth(1, Pot5#pot.active), Side2 = lists:nth(2, Pot5#pot.active), Current = Pot5#pot.current, io:format("Members: ~p all_in: ~p\n", [gb_trees:to_list(Side1#side_pot.members), Side1#side_pot.all_in]), io:format("Members: ~p all_in: ~p\n", [gb_trees:to_list(Side2#side_pot.members), Side2#side_pot.all_in]), io:format("Members: ~p all_in: ~p\n", [gb_trees:to_list(Current#side_pot.members), Current#side_pot.all_in]).

bayasaa avatar May 01 '20 03:05 bayasaa