From deb49db35c49b68837efab19ae67f6ec22fe4433 Mon Sep 17 00:00:00 2001 From: gitea-actions Date: Wed, 19 Aug 2026 22:22:50 +0200 Subject: [PATCH] =?UTF-8?q?tabulka=20na=20za=C4=8D=C3=A1tku=20ka=C5=BEd?= =?UTF-8?q?=C3=A9ho=20z=C3=A1znamu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dice.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/dice.py b/dice.py index e5ed833..69ab5df 100644 --- a/dice.py +++ b/dice.py @@ -1,6 +1,8 @@ import sys from os import name, system +from tabulate import tabulate + hraci = {} pointer = "" first = "" @@ -47,9 +49,23 @@ def next_player() -> None: pointer = nxt_key +table_header = ["Hráč", "Skóre"] + +def table(): + hraci_tab = [] + for h in hraci: + hrac = h + if pointer == h: + hrac = "> "+h + hraci_tab.append([hrac, hraci[h]]) + + return tabulate(hraci_tab, headers=table_header, tablefmt="fancy_grid") + def game(): while True: - table() + clear() + print(table()) + break def main() -> None: