Index: bunco_app.py ================================================================== --- bunco_app.py +++ bunco_app.py @@ -1,8 +1,39 @@ import bunco +from blessings import Terminal +t = Terminal() g = bunco.Game("players.csv") +def print_center(before, string, after): + col = int((t.width - len(string)) / 2) - 1 + print(f"{t.move_x(col)}{before}{string}{after}") + +def display_dashboard(): + print(t.clear,t.move(0,0)) + print_center(t.bold_red,"B U N C O S I M U L A T O R", t.normal) + print(f"{t.red}{'-'*t.width}{t.normal}\n") + + # Print column headings for rounds + rounds = [str(n + 1).rjust(4) for n in range(g.current_round())] + round_str = "".join(rounds) + print(f"{t.move_x(18)}{t.bold}{round_str}{t.normal}") + + # Print table of players and their scores each round + for table in g.tables: + print(f" {t.blue}{table}") + for player in table.players: + if player is bunco.fuzzydie_holder: + print(f"🎲",end='') + print(f"{t.move_x(3)}{t.cyan}{player}{t.normal}",end='') + for n in range(g.current_round()): + print(t.move_x(18+(4*n)),end='') + print(str(player.round_scores[n]).rjust(4),end='') + print('') + g.play_one_round() -print("\n\n\t\tB U N C O !!!\n\n") -g.print_status() +display_dashboard() +def do1(): + g.prep_next_round() + g.play_one_round() + display_dashboard()