This commit is contained in:
Fletcher Boyd 2013-09-05 09:46:49 +08:00
parent 2812569593
commit 7ab4f756fe
22 changed files with 69 additions and 78 deletions

View file

@ -15,11 +15,10 @@ def coin(inp, me=None):
amount = 1
if amount == 1:
me("flips a coin and gets %s." % random.choice(["heads", "tails"]))
me("flips a coin and gets {}.".format(random.choice(["heads", "tails"])))
elif amount == 0:
me("makes a coin flipping motion with its hands.")
else:
heads = int(random.normalvariate(.5 * amount, (.75 * amount) ** .5))
tails = amount - heads
me("flips %i coins and gets "
"%i heads and %i tails." % (amount, heads, tails))
me("flips {} coins and gets {} heads and {} tails.".format(amount, heads, tails))