def draw_line(x, y, clr, *ts): for t in ts: d = list(map(lambda n: n // abs(n) if n != 0 else 0, t[0])) for i in range(t[1]): set_pixel(x + i * d[0], y + i * d[1], clr) x += i * d[0] y += i * d[1]