ChatDev/WareHouse/DiceRollingSimulator_THUNLP_20230825072338/dice.py
2023-09-04 19:24:28 +08:00

6 lines
164 B
Python

import random
class Dice:
def __init__(self, num_sides):
self.num_sides = num_sides
def roll(self):
return random.randint(1, self.num_sides)