tabulka na začátku každého záznamu
This commit is contained in:
1 parent
98bad373a7
commit
deb49db35c
1 file changed
+17
-1
@@ -1,6 +1,8 @@
|
|||||||
import sys
|
import sys
|
||||||
from os import name, system
|
from os import name, system
|
||||||
|
|
||||||
|
from tabulate import tabulate
|
||||||
|
|
||||||
hraci = {}
|
hraci = {}
|
||||||
pointer = ""
|
pointer = ""
|
||||||
first = ""
|
first = ""
|
||||||
@@ -47,9 +49,23 @@ def next_player() -> None:
|
|||||||
|
|
||||||
pointer = nxt_key
|
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():
|
def game():
|
||||||
while True:
|
while True:
|
||||||
table()
|
clear()
|
||||||
|
print(table())
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
|||||||
Reference in new issue
Block a user