Skip to content

Instantly share code, notes, and snippets.

@SAPikachu
Created July 6, 2011 06:27
Show Gist options
  • Save SAPikachu/1066678 to your computer and use it in GitHub Desktop.
Save SAPikachu/1066678 to your computer and use it in GitHub Desktop.
周泰死亡率模拟
# 周泰死亡率模拟
# 假设各点数出现的概率完全一样
import random
import math
p = [0 for x in range(14)]
count = 0
while True:
for i in range(14):
if random.randint(0,12) < i:
p[i] += 1
break
count += 1
if count >= 10000 and math.log10(count) % 1 == 0:
print(count, p)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment