Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Created December 5, 2013 05:33
Show Gist options
  • Save fowlmouth/7800592 to your computer and use it in GitHub Desktop.
Save fowlmouth/7800592 to your computer and use it in GitHub Desktop.
iterator countfrom (start, fin: int, step = 1): int =
if start < fin:
for i in countup(start, fin, step):
yield i
else:
for i in countdown(start, fin, step):
yield i
for x in countfrom(10,1):
echo x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment