From 0682ad88ce0cccff24ab0c7fa4fe18d5a122e778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sp=C3=A1=C4=8Dil?= Date: Fri, 26 Jun 2026 20:21:08 +0200 Subject: [PATCH 1/3] =?UTF-8?q?feature/vynulovani:=20byla=20implementov?= =?UTF-8?q?=C3=A1na=20logika=20pro=20vynulov=C3=A1n=C3=AD:=20po=20t=C5=99e?= =?UTF-8?q?t=C3=ADm=20tahu=20kon=C4=8D=C3=ADc=C3=ADm=20nulou=20dojde=20k?= =?UTF-8?q?=20vynulov=C3=A1n=C3=AD=20celkov=C3=A9ho=20sk=C3=B3re=20hr?= =?UTF-8?q?=C3=A1=C4=8De?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.py b/main.py index d2f916d..74e5396 100644 --- a/main.py +++ b/main.py @@ -122,6 +122,14 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple: return data elif inp == "k": global score + + if score == 0: + last_two = players[pointer][-2:] + if len(last_two) > 1: + last_two_sum = sum(last_two) + if last_two_sum == 0: + score = -sum(players[pointer]) + players[pointer].append(score) aggr[pointer] = sum(players[pointer]) score = 0 -- 2.47.3 From cef9468ad0b81c5e214018ed980916c214e928a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sp=C3=A1=C4=8Dil?= Date: Fri, 26 Jun 2026 20:33:33 +0200 Subject: [PATCH 2/3] =?UTF-8?q?feature/vynulovani:=20p=C5=99id=C3=A1n=20uk?= =?UTF-8?q?azatel=20p=C4=8Dtu=20"strik=C5=AF"=20v=20podob=C4=9B=20jednoho?= =?UTF-8?q?=20a=C5=BE=20dvou=20X=20vedle=20celkov=C3=A9ho=20sk=C3=B3re=20h?= =?UTF-8?q?r=C3=A1=C4=8De?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 74e5396..5478d5e 100644 --- a/main.py +++ b/main.py @@ -233,7 +233,18 @@ def game(data: tuple): th = throw(count) clear() print(f"Vítězné skóre: {final_score}.") - print(f"Na tahu je {pointer} ({aggr[pointer]}).") + + strikes = "" + + if len(players[pointer]) > 0: + if players[pointer][-1:][0] == 0: + strikes = "x" + if players[pointer][-2:][0] == 0: + strikes += "x" + else: + strikes = "" + + print(f"Na tahu je {pointer} ({aggr[pointer]}{strikes}).") print(show_throw(th)) if not check_value(th) and data[2] == "" and count != 0: global score -- 2.47.3 From e7c8d99c96b9482d282588e87e128c75f21b3d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sp=C3=A1=C4=8Dil?= Date: Fri, 26 Jun 2026 20:37:38 +0200 Subject: [PATCH 3/3] =?UTF-8?q?feature/vynulovani:=20p=C5=99id=C3=A1na=20k?= =?UTF-8?q?ondolen=C4=8Dn=C3=AD=20hl=C3=A1=C5=A1ka?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 5478d5e..ce7fa5b 100644 --- a/main.py +++ b/main.py @@ -129,6 +129,8 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple: last_two_sum = sum(last_two) if last_two_sum == 0: score = -sum(players[pointer]) + clear() + input("Po třech nulových hodech bylo vaše skóre vynulováno.") players[pointer].append(score) aggr[pointer] = sum(players[pointer]) @@ -243,7 +245,7 @@ def game(data: tuple): strikes += "x" else: strikes = "" - + print(f"Na tahu je {pointer} ({aggr[pointer]}{strikes}).") print(show_throw(th)) if not check_value(th) and data[2] == "" and count != 0: -- 2.47.3