def congratulate_winner(screen, community_cards, winners, guess_msg):
    winners_str = ""
    for i, w in enumerate(winners, start=1):
        if len(winners) == 2 and i == 1:
            winners_str += str(w) + " and "
        elif len(winners) == i:
            winners_str += str(w)
        elif len(winners) == i + 1:
            winners_str += str(w) + ", and "
        elif len(winners) != 1:
            winners_str += str(w) + ", "
        else:
            winners_str += str(w)

    if len(winners) == 1:
        winner_message = "\n\nPlayer " \
            + winners_str      \
            + " has the best hand!"
    else:
        winner_message = "\n\nPlayer " \
            + winners_str      \
            + " have the best hand!"

    screen_tmp = screen                                  \
           + str(community_cards)                  \
           + winner_message                        \
           + guess_msg
    util.clear_screen()
    print(screen_tmp)
    util.process_continuation_input(screen_tmp)
Ejemplo n.º 2
0
def draw_screen(screen, is_pause):
    user = screen[0]
    playing_hands = screen[1]
    community_cards = screen[2]
    tutorial_msg = screen[3]

    util.clear_screen()
    to_draw = str(user) + playing_hands + str(community_cards) + tutorial_msg
    print(to_draw)
    if is_pause:
        util.process_continuation_input(to_draw)
def display_table(screen, community_cards):
    util.clear_screen()
    screen_tmp = screen + str(community_cards)
    print(screen_tmp)
    util.process_continuation_input(screen_tmp)