Update plugins/coin.py
This commit is contained in:
parent
b5fbcaaefc
commit
86facabf70
|
@ -3,12 +3,11 @@ from util import hook
|
|||
from random import getrandbits
|
||||
|
||||
|
||||
# used for tails: x heads: y
|
||||
# yay for cryptic but fast code
|
||||
def flip_simple(count):
|
||||
heads, tails = 0, 0
|
||||
for x in xrange(count):
|
||||
c = getrandbits(1)
|
||||
if c == 0:
|
||||
if not getrandbits(1):
|
||||
heads += 1
|
||||
else:
|
||||
tails += 1
|
||||
|
|
Reference in a new issue