Tidied up plugins/coin.py

This commit is contained in:
Luke Rogers 2012-02-20 16:34:17 +13:00
parent 73f1a107ed
commit e10637c366

View file

@ -1,8 +1,8 @@
# # Lukeroge # Created by Lukeroge, improved by TheNoodle
from util import hook from util import hook
import random import random
# used for tals: x heads: y # used for tails: x heads: y
def flip_simple(count): def flip_simple(count):
heads = 0 heads = 0
tails = 0 tails = 0
@ -40,5 +40,5 @@ def coin(inp):
return "You flip a coin and get "+sidename+"." return "You flip a coin and get "+sidename+"."
else: else:
flips = flip_simple(count) flips = flip_simple(count)
return "You flip "+str(count)+" coins and get " +str(flips[0])+" heads and "+str(flips[1])+" tails." return "You flip %s coins and get %s heads and %s tails." % (str(count), str(flips[0]), str(flips[0]))