Determining winning amount in Poker without creating side-pots

后端 未结 2 1270
忘掉有多难
忘掉有多难 2021-02-14 19:14

I\'m trying to run a poker simulation and have the following data about a poker table

  • how much each player contributed to the pot
  • a \"hand score\" (after
2条回答
  •  轮回少年
    2021-02-14 19:39

    First sort by score descending, so you'll end up with two groups: { 0, 2 }, { 1 }.

    Then, sort each group by the order they have contributed ascending: { 2 (20), 0 (100) }, { 1 (80) }.

    Now, divide the pot in that order:

    1. First you'll take (max) 20 away from each players contributions to create the first pot. And divide it evenly to 2 and 0. The first pot will be (20 + 20 + 20 = 60. So both 0 and 2 will be given 30). After that, the first players winnings are done, and you are left with: { 0 (80) }, { 1 (60) }.

    2. Now, you'll take (max) 80 away from each players contributions to create the next pot (80 + 60 = 140). And give it to 0 (no division needed as there are no longer more than one in the top group, so 0 will receive the whole 140). You'll be left with: { 1 (0) }.

    3. No more contributions left, so you are done.

    So, in total in your example, 0 would receive 170 and 2 would receive 30.

提交回复
热议问题