Server & Game refactor basics

This commit is contained in:
KuMiShi
2026-01-29 16:55:45 +01:00
parent 50d2b16224
commit e655de8f54
23 changed files with 189 additions and 121 deletions

12
dice.py
View File

@@ -1,13 +1,13 @@
# Native imports
import random as rd
class Dice():
def __init__(self, num_faces:int=20):
self.num_faces = num_faces
@staticmethod
def roll(num_faces=20):
return rd.randrange(start=1, stop=num_faces+1, step=1)
def roll(self):
return rd.randrange(start=1, stop=self.num_faces+1, step=1)
def head_or_tails(self):
@staticmethod
def head_or_tails():
result = rd.randint(0,1)
if result: # true
return "head" # face