PEP8, lots of tweaks/fixes

This commit is contained in:
neersighted 2012-04-02 09:17:55 -07:00
parent 641b770dc3
commit 508fec8ae8
29 changed files with 165 additions and 111 deletions

View file

@ -1,7 +1,5 @@
"""
dice.py: written by Scaevolus 2008, updated 2009
simulates dicerolls
"""
# Written by Scaevolus, updated by Lukeroge
import re
import random
@ -30,7 +28,8 @@ def nrolls(count, n):
return [random.randint(1, n) for x in xrange(count)]
else: # fake it
return [int(random.normalvariate(.5 * (1 + n) * count,
(((n+1)*(2*n+1)/6.-(.5*(1+n))**2)*count)**.5))]
(((n + 1) * (2 * n + 1) / 6. -
(.5 * (1 + n)) ** 2) * count) ** .5))]
@hook.command('roll')