Skip to content

Instantly share code, notes, and snippets.

@fcicq
Created July 25, 2012 11:29
Show Gist options
  • Select an option

  • Save fcicq/3175644 to your computer and use it in GitHub Desktop.

Select an option

Save fcicq/3175644 to your computer and use it in GitHub Desktop.
fcicq's dice
import random
# E = 129.875
def dice():
s = random.randint(1, 20)
if s <= 2: return random.randint(1, 20)
if s <= 8: return random.randint(21, 50)
if s <= 14: return random.randint(51, 99)
if s <= 17: return random.randint(100, 200)
if s <= 19: return random.randint(201, 500)
return random.randint(501, 1024)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment