Skip to content

Instantly share code, notes, and snippets.

@varepsilon
Created April 7, 2012 08:16
Show Gist options
  • Save varepsilon/2326435 to your computer and use it in GitHub Desktop.
Save varepsilon/2326435 to your computer and use it in GitHub Desktop.
Alisa's range
def ARange(N):
if N < 1:
return
q = (N - 1) // 4
i = 0
while i < q:
yield i
i += 1
yield i
i += 1
yield i
i += 1
yield i
i += 1
while i < N:
yield i
i += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment