.vim-template:.py
def int_points_between(
    start: Tuple[int, int], end: Tuple[int, int]
) -> Generator[Tuple[int, int], None, None]:
    """
    Return a generator of all of the integer points between two given points. Note that
    you are *not* guaranteed that the points will be given from `start` to `end`, but
    all points will be included.
    """
    x1, y1 = start
    x2, y2 = end
    if x1 == x2:
        yield from ((x1, y) for y in dirange(y1, y2))
    elif y1 == y2:
        yield from ((x, y1) for x in dirange(x1, x2))
    else:
        # If `x1 > x2`, that means that `start` is to the right of `end`, so we need to
        # switch the points around so iteration always goes in the positive `x`
        # direction.
        if x1 > x2:
            x1, x2, y1, y2 = x2, x1, y2, y1
        dy = y2 - y1
        dx = x2 - x1
        slope = Fraction(dy, dx)
        for i in irange(dy // slope.numerator):
            yield (x1 + (i * slope.denominator), y1 + (i * slope.numerator))

    Return a generator of all of the integer points between two given points. Note that
    you are *not* guaranteed that the points will be given from `start` to `end`, but
    all points will be included.
    
Return a generator of all of the integer points between two given points. Note that
you are *not* guaranteed that the points will be given from `start` to `end`, but
all points will be included.
Return a generator of all of the integer points between two given points . Note that you are * not * guaranteed that the points will be given from ` start ` to ` end ` but all points will be included .
def int_points_between(
    start: Tuple[int, int], end: Tuple[int, int]
) -> Generator[Tuple[int, int], None, None]:
    x1, y1 = start
    x2, y2 = end
    if x1 == x2:
        yield from ((x1, y) for y in dirange(y1, y2))
    elif y1 == y2:
        yield from ((x, y1) for x in dirange(x1, x2))
    else:
        if x1 > x2:
            x1, x2, y1, y2 = x2, x1, y2, y1
        dy = y2 - y1
        dx = x2 - x1
        slope = Fraction(dy, dx)
        for i in irange(dy // slope.numerator):
            yield (x1 + (i * slope.denominator), y1 + (i * slope.numerator))
def int_points_between ( start : Tuple [ int , int ] , end : Tuple [ int , int ] ) -> Generator [ Tuple [ int , int ] , None , None ] : x1 , y1 = start x2 , y2 = end if x1 == x2 : yield from ( ( x1 , y ) for y in dirange ( y1 , y2 ) ) elif y1 == y2 : yield from ( ( x , y1 ) for x in dirange ( x1 , x2 ) ) else : if x1 > x2 : x1 , x2 , y1 , y2 = x2 , x1 , y2 , y1 dy = y2 - y1 dx = x2 - x1 slope = Fraction ( dy , dx ) for i in irange ( dy // slope . numerator ) : yield ( x1 + ( i * slope . denominator ) , y1 + ( i * slope . numerator ) )
Return a generator of all of the integer points between two given points.
Return a generator of all of the integer points between two given points .
"""
    Return a generator of all of the integer points between two given points. Note that
    you are *not* guaranteed that the points will be given from `start` to `end`, but
    all points will be included.
    """ # If `x1 > x2`, that means that `start` is to the right of `end`, so we need to # switch the points around so iteration always goes in the positive `x` # direction.
start
Tuple[int, int]
end
Tuple[int, int]