iterator count[T: SomeInteger](x, y: T): T =
if x < y:
for n in countup(x, y): yield n
else:
for n in countdown(x, y): yield n
RunThis is what I used. This retains the direction.
iterator count[T: SomeInteger](x, y: T): T =
if x < y:
for n in countup(x, y): yield n
else:
for n in countdown(x, y): yield n
RunThis is what I used. This retains the direction.