Skip to content

Instantly share code, notes, and snippets.

@gngdb gngdb/

Created Apr 9, 2020
What would you like to do?
Pure Python Gumbel Dice
import dice
import dice
import dice
import math
from random import random
def gumbel(eps=1e-6):
U = random()
return -math.log(-math.log(U+eps)+eps)
def roll(sides):
G = [gumbel() for i in range(sides)]
return [i for g,i in zip(G, range(sides)) if g == max(G)][0]+1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.