Example #1
0
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
Example #2
0
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