From 06474e7f68fa29b165f02c87419c01c398a6f538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sp=C3=A1=C4=8Dil?= Date: Sat, 27 Jun 2026 19:06:12 +0200 Subject: [PATCH] =?UTF-8?q?enhancement/pismena:=20p=C5=99evod=20z=20=C4=8D?= =?UTF-8?q?=C3=ADsel=20na=20p=C3=ADsmena=20a=20zp=C4=9Bt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kostky/kostky.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/kostky/kostky.py b/kostky/kostky.py index 92e2333..dbf8996 100644 --- a/kostky/kostky.py +++ b/kostky/kostky.py @@ -44,8 +44,8 @@ def show_throw(throw: str) -> str: for _i in range(1, len(throw_temp) + 1): pretty_list += "^ " pretty_list += "\n" - for i in range(1, len(throw_temp) + 1): - pretty_list += f"{i} " + for i in range(len(throw_temp)): + pretty_list += f"{chr(97+i)} " return pretty_list def clear() -> None: @@ -75,7 +75,9 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple[Any, ...]: pointer = nxt_key inp = str(inp) - if re.search(r"^\d+$", inp): + inp_temp: str = "" + + if re.search(r"^[a-f]+$", inp): if len(inp) > count: data: tuple[Any, ...] = ( "msg", @@ -86,7 +88,7 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple[Any, ...]: ) else: for x in inp: - x = int(x) + x = ord(x)-96 if x > count: ran = "1" if count == 1 else f"1–{count}" data = ( @@ -97,6 +99,10 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple[Any, ...]: throw ) return data + else: + inp_temp += str(x) + inp = inp_temp + old_throw: list[str] = [] pick: list[str] = [] for y in range(count):