def parse_results(results):
    """ parses the results file into a dictionary of names and tuples """
    # hold the results in a dictionary
    results_dict = {}
    # loop over each line (result)
    for result in results:
        # split the string based on spaces
        parts = result.split()
        # there should only be a name and an outcome ('w', 'l')
        if len(parts) > 2:
            raise Exception("the results file has a bad format")
        # keep track of the name and the outcome so I don't have to use 
        # parts[0] and parts[1]
        name = parts[0]
        outcome = parts[1]
        # add the name to the dictionary if it's not already there
        if name not in results_dict:
            results_dict[name] = (0, 0)
        # modify the results tuple according to whether its a win or loss
        if outcome == 'w':
            results_dict[name] = (results_dict[name][0]+1, results_dict[name][1])
        elif outcome == 'l':
            results_dict[name] = (results_dict[name][0], results_dict[name][1]+1)
        else:
            raise Exception("I didn't recognize the outcome")
    return results_dict