feature: multiplayer – registrace hráčů, střídání tahů a agregace skóre #9
@@ -68,7 +68,7 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple:
|
|||||||
pointer = nxt_key
|
pointer = nxt_key
|
||||||
|
|
||||||
inp = str(inp)
|
inp = str(inp)
|
||||||
if re.search("^\d+$", inp):
|
if re.search(r"^\d+$", inp):
|
||||||
if len(inp) > count:
|
if len(inp) > count:
|
||||||
data = ("msg", "ER01", "Tolika kostkami nemůžete hodit. Zkuste to znovu:", count, throw)
|
data = ("msg", "ER01", "Tolika kostkami nemůžete hodit. Zkuste to znovu:", count, throw)
|
||||||
return data
|
return data
|
||||||
@@ -105,6 +105,13 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple:
|
|||||||
elif inp == "h":
|
elif inp == "h":
|
||||||
data = ("count", count, "")
|
data = ("count", count, "")
|
||||||
return data
|
return data
|
||||||
|
elif inp == "k":
|
||||||
|
global score
|
||||||
|
players[pointer].append(score)
|
||||||
|
score = 0
|
||||||
|
next_player()
|
||||||
|
data = ("count", 6, "")
|
||||||
|
return data
|
||||||
|
|
||||||
def check_value(throw: str) -> bool:
|
def check_value(throw: str) -> bool:
|
||||||
throw_s = sorted(throw)
|
throw_s = sorted(throw)
|
||||||
|
|||||||
Reference in New Issue
Block a user