예제 #1
0
def run_each_week(string):
    global division_standings
    for week, games in sorted(schedule.iteritems(),
                              key=lambda (k, v): int(k.split(" ")[1])):
        string = determine_winners(week, games, string)
        string = common.add_breaks_to_string(string)
        division_standings = common.update_division_records(records)
        string = common.print_records_by_div(string, division_standings)
        string = common.add_breaks_to_string(string)
    return string
예제 #2
0
def predict_games(uptoweek, endweek, string):
    global schedule, records, games, division_standings
    schedule = common.schedule

    games = common.get_games(uptoweek)

    records = common.update_records(games, records, uptoweek)

    i = uptoweek
    while i <= endweek:
        week = "WEEK {0}".format(i)
        gamestoplay = schedule.get(week)
        string = determine_winners(week, gamestoplay, string)
        string = common.add_breaks_to_string(string)
        division_standings = common.update_division_records(records)
        string = common.print_records_by_div(string, division_standings)
        i += 1
    return string
예제 #3
0
def predict_games(uptoweek, endweek, string):
    global schedule, records, division_standings
    schedule = common.schedule

    games = common.get_games(uptoweek)

    records = common.update_records(games, records, uptoweek)

    i = uptoweek
    while i <= endweek:
        week = "WEEK {0}".format(i)
        gamestoplay = schedule.get(week)
        string = determine_winners(week, gamestoplay, string)
        division_standings = common.update_division_records(records)
        string = common.print_records_by_div(string, division_standings)
        i += 1

    return string