Bunco Simulator

Diff

Differences From Artifact [9349c8]:

To Artifact [b5e7e7]:


1

2

3
4



5
6
7

























8




1
2
3
4
5
6
7
8
9



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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}")
g.play_one_round()
print("\n\n\t\tB U N C O !!!\n\n")
g.print_status()

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()
display_dashboard()

def do1():
    g.prep_next_round()
    g.play_one_round()
    display_dashboard()