Overview
| Comment: | Evolve dashboard display |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
3270d1d9cb94286fba48da739f5b550c |
| User & Date: | joel on 2018-11-22 04:05:33 |
| Other Links: | manifest | tags |
Context
|
2018-11-22
| ||
| 05:18 | Summary texts for players after each round check-in: 562309 user: joel tags: trunk | |
| 04:05 | Evolve dashboard display check-in: 3270d1 user: joel tags: trunk | |
| 04:04 | Fix bug that prevented tracking fuzzy die check-in: 7a0a5b user: joel tags: trunk | |
Changes
Modified bunco_app.py from [9349c8] to [b5e7e7].
1 2 3 4 |
import bunco
g = bunco.Game("players.csv")
| > > > > > | > > > > > > > > > > > > > > > > > > > > | | > > > > > > | 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}")
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()
|