From 9967682373c697ce9ee0e1edc43ecfe6c512c64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sp=C3=A1=C4=8Dil?= Date: Sat, 27 Jun 2026 09:24:56 +0200 Subject: [PATCH] =?UTF-8?q?refactoring:=20ve=20funkci=20evaluate=20slou?= =?UTF-8?q?=C4=8Deny=20p=C5=99ebyte=C4=8Dn=C3=A9=20returny?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/main.py b/main.py index ce7fa5b..c63029c 100644 --- a/main.py +++ b/main.py @@ -78,7 +78,6 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple: if re.search(r"^\d+$", inp): if len(inp) > count: data = ("msg", "ER01", "Tolika kostkami nemůžete hodit. Zkuste to znovu:", count, throw) - return data else: for x in inp: x = int(x) @@ -110,7 +109,7 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple: h_bool = False data = ("count", new_count, old_throw) - return data + elif inp == "h": if h_bool: clear() @@ -119,7 +118,7 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple: else: h_bool = True data = ("count", count, "") - return data + elif inp == "k": global score @@ -142,13 +141,14 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple: winner = check_win() if winner: data = ("win", winner, aggr[winner]) - return data + elif inp == "exit": data = ("exit",) - return data + else: data = ("msg", "ER03", "Zadejte prosím platnou hodnotu:", count, throw) - return data + + return data def check_value(throw: str) -> bool: throw_s = sorted(throw)