def refresh(world): player_n = _game.get_active_player(world) if len(world['players'][player_n]["regions"]) < 1: world['end'] = 1 else: world['players'] = _game.swap_turns(world['players']) return world
def process_action(world, action): '''processes integer inputs into actions''' print action players = world['players'] player_n = _game.get_active_player(world) if action < 13: player = _game.attack(players, action) print "attacked" else: player = _game.invest(world['players'][player_n]) print "invested" print world return world