From 0e134eb4a873f0a594887206e4c661e7004ccf1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sp=C3=A1=C4=8Dil?= Date: Tue, 23 Jun 2026 22:15:31 +0200 Subject: [PATCH] =?UTF-8?q?feature/hraci:=20p=C5=99id=C3=A1n=20ukazatel=20?= =?UTF-8?q?aktivn=C3=ADho=20hr=C3=A1=C4=8De=20s=20aktu=C3=A1ln=C3=ADm=20sk?= =?UTF-8?q?=C3=B3re=20p=C5=99es=20agrega=C4=8Dn=C3=AD=20prom=C4=9Bnnou?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index a77dfe7..820743e 100644 --- a/main.py +++ b/main.py @@ -10,6 +10,7 @@ players = {} pointer = "" first = "" h_bool = True +aggr = {} with open("hodnoty.csv", "r") as csv_file: csv_reader = csv.reader(csv_file) @@ -120,6 +121,7 @@ def evaluate(inp: Any, count: int, throw: str) -> tuple: elif inp == "k": global score players[pointer].append(score) + aggr[pointer] = sum(players[pointer]) score = 0 h_bool = True next_player() @@ -160,6 +162,7 @@ def add_players(iter=False): print("Zadávejte, prosím, unikátní jména.") else: players[inp] = [] + aggr[inp] = 0 print(f"Do seznamu přidáno jméno {inp}.") if not iter: pointer = inp @@ -173,6 +176,7 @@ def game(data: tuple): if(th == ""): th = throw(count) clear() + print(f"Na tahu je {pointer} ({aggr[pointer]})") print(show_throw(th)) if not check_value(th) and data[2] == "" and count != 0: global score @@ -188,7 +192,6 @@ def game(data: tuple): " - Hodit znovu: [h].\n" f" - Ukončit hod a ponechat si skóre z tohoto hodu ({score}): [k].\n" ) - print(players) # if old_throw != "": # msg += f"\nHodnoty odložených kostek: {old_throw}" inp = input(msg)