小编Lem*_*m0n的帖子

确定扑克中的获胜金额而不创建边池

我正在尝试进行扑克模拟并获得有关扑克桌的以下数据

  • 每个球员贡献了多少钱
  • 每个玩家的"手牌得分"(翻牌后)(即player[0].score == player[1].score,他们并列)

我不知道每个玩家应该赢得多少,而不需要创建副圈并为每个玩家分配玩家.

例如,

player[0].contributed = 100
player[1].contributed = 80
player[2].contributed = 20
Run Code Online (Sandbox Code Playgroud)

player[0].score = 10
player[1].score = 2
player[2].score = 10
Run Code Online (Sandbox Code Playgroud)

total_pot = 200;
Run Code Online (Sandbox Code Playgroud)

在这个例子中,我首先需要返回player[0]20并将其从锅中取出吗?

然后,因为player[0]并且player[2]已经并列第一名并且player[1]已经输了,所以应该将底池划分为:

player[0].received = 170
player[1].received = 0
player[2].received = 30
Run Code Online (Sandbox Code Playgroud)

然后,如果player[1]赢了,应该将底池划分为:

player[0].received = 20
player[1].received = 180
player[2].received = 0
Run Code Online (Sandbox Code Playgroud)

algorithm poker

9
推荐指数
1
解决办法
2111
查看次数

标签 统计

algorithm ×1

poker ×1