diff --git a/casinx.py b/casinx.py index cf38fbf..8d18030 100644 --- a/casinx.py +++ b/casinx.py @@ -1,6 +1,8 @@ #!/usr/bin/python3 from random import randint from time import sleep +from os import get_terminal_size +x,y = get_terminal_size().columns,get_terminal_size().lines ## variablen zeichen = "%-+#$~" slots = [["a","b","c"], #slot 1 @@ -10,14 +12,16 @@ slots = [["a","b","c"], #slot 1 ## funtionen def pslots(): tren = "+-----------+" - pr = "| " + halb = int(x/2)-5 + space = "-"*halb + pr = f"{space}| " for b in range(0,3): for a in range(0,3): pr += slots[a][b]+" " - pr += "|\n| " - print(tren) - print(pr[:-4]) - print(tren) + pr += f"|\n{space}| " + print(space+tren) + print(pr[:-(space[:-3])]) + print(space+tren) def roll_slot(slots,slot=int,new_zeichen=str): back = slots[slot]