refactoring: ve funkci evaluate sloučeny přebytečné returny

This commit is contained in:
David Spáčil
2026-06-27 09:24:56 +02:00
parent c225161374
commit 9967682373
+6 -6
View File
@@ -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)