def make_facedown_move(): global game card_index = c.request_from_face_down(game.current_player()) cards = game.get_cards([card_index]) if not game.valid_move(cards): c.show_bad_facedown_choice(cards) c.wait_user() game.pickup_with_facedown_card(cards) else: game.lay_cards(cards) continue_main_game()
def main_game(): global game while game.continue_game(): if game.playing_from_face_down(): make_facedown_move() else: if game.can_play(): make_move() else: c.show_pickup(game.current_player()) c.wait_user() game.pickup() continue_main_game()
def create_game(): global game num_players = c.request_num_players() num_cards_each = c.request_num_cards_each() player_names = [] for i in range(num_players): player_name = c.request_player_name(i) player_names.append(player_name) game = Game(num_players, num_cards_each, player_names) game.deal() c.clear_screen() c.show_game(game) c.wait_user()
def end_game(): global game pythonhead = game.get_pythonhead() c.show_pythonhead(pythonhead) c.wait_user()