feature: multiplayer – registrace hráčů, střídání tahů a agregace skóre #9

Merged
david-spacil merged 10 commits from feature/hraci into version/v0.1.0 2026-06-23 22:43:05 +02:00
Showing only changes of commit 9added3200 - Show all commits
+8 -1
View File
@@ -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)