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 973a08ebd5 - Show all commits
+6 -1
View File
@@ -127,6 +127,9 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple:
next_player() next_player()
data = ("count", 6, "") data = ("count", 6, "")
return data return data
else:
data = ("msg", "ER03", "Zadejte prosím platnou hodnotu:", count, throw)
return data
def check_value(throw: str) -> bool: def check_value(throw: str) -> bool:
throw_s = sorted(throw) throw_s = sorted(throw)
@@ -192,6 +195,7 @@ def game(data: tuple):
" - Hodit znovu: [h].\n" " - Hodit znovu: [h].\n"
f" - Ukončit hod a ponechat si skóre z tohoto hodu ({score}): [k].\n" f" - Ukončit hod a ponechat si skóre z tohoto hodu ({score}): [k].\n"
) )
print(f"Count je {count}")
# if old_throw != "": # if old_throw != "":
# msg += f"\nHodnoty odložených kostek: {old_throw}" # msg += f"\nHodnoty odložených kostek: {old_throw}"
inp = input(msg) inp = input(msg)
@@ -199,10 +203,11 @@ def game(data: tuple):
game(data) game(data)
elif data[0] == "msg": elif data[0] == "msg":
if data[1] == "ER01" or data[1] == "ER02": if data[1] == "ER01" or data[1] == "ER02" or data[1] == "ER03":
msg = data[2] msg = data[2]
count = data[3] count = data[3]
th = data[4] th = data[4]
clear()
inp = input(msg) inp = input(msg)
data = evaluate(inp, count, th) data = evaluate(inp, count, th)
game(data) game(data)