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