Example #1
0
def main(args):

    # House builds table and establishes rules
    table_rules = TableConfig(args)
    table = CrapsTable(table_rules, args)
    tracker = Tracker()

    for k in range(args.series):
        # New Player enters the game
        player = Player(args)
        tracker.new_series(player)
        for i in range(args.rounds):
            playing = table.play_round(player)
            tracker.log_round(player)

            if not playing:
                if args.v:
                    cprint('Exit at round {}'.format(i), 'yellow')
                break
        tracker.end_series(player)

        if args.v:
            if player.broke:
                cprint('~*~*~*~*~*~*~*~*~*~*~*~', 'red')
            else:
                cprint('~*~*~*~*~*~*~*~*~*~*~*~', 'green')
            cprint('Peak $$$: {}'.format(player.max), 'cyan')
            cprint('Low  $$$: {}'.format(player.min), 'magenta')
        if not args.v:
            printProgressBar(k, args.series)

    tracker.summarize(player)