MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / roll

Method roll

maths/monte_carlo_dice.py:13–14  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

11 self.sides = list(range(1, Dice.NUM_SIDES + 1))
12
13 def roll(self):
14 return random.choice(self.sides)
15
16
17def throw_dice(num_throws: int, num_dice: int = 2) -> list[float]:

Callers 2

_choose_a2Method · 0.80
throw_diceFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected