Beispiel #1
0
def choose_key_from_dict(d):
    list_options(d)
    option_chosen = ui.get_int_input(len(d)) - 1
    if option_chosen == -1:
        return -1
    key = list(d.keys())[option_chosen]
    return key
 def run_game(self):
     """Run rounds of the game until player decides to exist."""
     UI.say_welcome()
     # show game menu and run rounds until player decides to exit
     while True:
         UI.print_game_menu()
         choice = UI.get_int_input(1, 2)
         if choice == 1:
             # set up self.players before round starts
             self.players = UI.get_player_information(MAX_PLAYERS)
             self.run_round()
         else:
             break
     UI.say_goodbye()
Beispiel #3
0
def round_details(round, people, drinks):
    os.system("clear")
    print(round)
    ui.print_table("Orders", round.orders)
    print("Options:")
    print("\t1. Add to Order")
    print("\t2. Mark Completed")
    print("\t3. Change Maker")
    print("\t0. Return")
    menu_option = ui.get_int_input(3)

    if menu_option == 1:
        add_order_to_round(round, people, drinks)
    if menu_option == 2:
        round.finish_round()
    if menu_option == 3:
        print("Not implemented")
    if menu_option == 0:
        return
Beispiel #4
0
def choose_option_from_list(list):
    list_options(list)

    return ui.get_int_input(len(list)) - 1
Beispiel #5
0
            exit()

        print("Command not recognised")
        exit()

    # System Start
    # ui.start_title()

    while True:

        os.system("clear")

        ui.print_menu()

        menu_option = ui.get_int_input(10)

        if menu_option == 1:
            os.system("clear")
            person_option(people, teams, drinks)

        if menu_option == 2:
            os.system("clear")
            view_people(people)

        if menu_option == 3:
            os.system("clear")
            drink_option(drinks)

        if menu_option == 4:
            os.system("clear")