# Consider if this is the correct location for this element

def test_valid_coord(coord):
    """
    Fill in
    """
    assert type(coord) is tuple, "{} is not a tuple (coord)".format(coord)
    assert type(coord[0]) is int, "{} is not an int (coord 0)".format(coord[0])
    assert type(coord[1]) is int, "{} is not an int (coord 1)".format(coord[1])
    assert coord[0] > -1, "{} must be greater than zero (coord 0)".format(coord[0])
    assert coord[1] > -1, "{} must be greater than zero (coord 1)".format(coord[1])
    return True

# This can probably be consolidated into an error class

def coord_range(coord0, coord1):
    """
    Returns a list of coordinates for a table (by row) between two coordinate points of the form (0,0) where the first coordinate value is less than the second in both axes

    @parameter - coord0, type = tuple
    @parameter - coord1, type = tuple

    @return, type = list of tuples or error

    @dependencies, test_valid_coord (lf) which returns true or raises an assertion error
    """
    # _Testing
    if test_valid_coord(coord0) and test_valid_coord(coord1):
        pass
    else:
        raise TypeError("Rewrite coordinates") # consider if type error is the best error for this

    # _Main
    ret_list = []
    if coord0[0] <= coord1[0] and coord0[1] <= coord1[1]:
        init0 = coord0[0]
        init1 = coord0[1]
        while init0 < coord1[0] + 1:
            while init1 < coord1[1] + 1:
                ret_list.append((init0,init1))
                init1 += 1
            init0 += 1
            init1 = coord0[1]
    else:
        raise TypeError("Specify a valid start and end coordinate")
    return ret_list
