好吧,所以我差不多完成了这件事。所以我被困在一个双循环中,打印后没有打印(赢钱),所以有些东西不对,但我不确定有什么问题,但是这里是代码。而且它没有为单个玩家存储笔记或提醒或积分。如果任何人都可以帮助我,我将不胜感激。Point.py打印,但停止打印
winnings = []
for n in range(len(ratios)):
winnings.append(pot*ratios[n])
print(winnings) #STOPS HERE
for winning in winnings[1:]:
# loop over all but the first element in winnings
winning = int(winning)
for i, player in enumerate(players[1:]):
# loop over all but the first player, adding indices
notes.store("~lottery~", player, "The system has placed you %s in the lottery. The lottery awarded you %s P$" % (Point.ordinal(i), winning), time.time())
alerts.append(player)
point = Point.dPoint[player] + winning
Point.dPoint[player] = point
return True
elif len(players) == 0:
“赢”是长度为1的列表,也许? –
那么当我测试它时,奖金列表中只有1件东西,所以是的。 – user3103923