有人可以告诉我为什么我的节目不起作用吗?即使我将s
设置为10000.
当我打印出wins
和plays
时,它只显示为0和1。
def manyCraps(s):
wins = 0
plays = 0
dice1 = randint(1,6)
dice2 = randint(1,6)
total = dice1 + dice2
for i in range(s):
if total == 7 or total == 11:
wins = wins + 1
plays = plays + 1
else:
if total == 2 or total == 3 or total == 12:
plays = plays + 1
else:
plays = plays + 1
dice3 = randint(1,6)
dice4 = randint(1,6)
total = dice3 + dice4