Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative pot issue #9

Open
bayasaa opened this issue May 1, 2020 · 0 comments
Open

Negative pot issue #9

bayasaa opened this issue May 1, 2020 · 0 comments

Comments

@bayasaa
Copy link

bayasaa commented May 1, 2020

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 bayasaa changed the title Minus pot issue Negative pot issue May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant