This function takes the name of a file in grid_task format and returns
    the dimensions of the world it represents.

def get_world_dimensions(gridfile, delim=" "):
    """
    This function takes the name of a file in grid_task format and returns
    the dimensions of the world it represents.
    """
    infile = open(gridfile)
    lines = infile.readlines()
    infile.close()
    world_x = len(lines[0].strip().split(delim))
    world_y = len(lines)
    return (world_x, world_y)