Skip to content

Instantly share code, notes, and snippets.

@saevarb
Created October 25, 2015 00:10
Show Gist options
  • Save saevarb/26705bb22f817c94608d to your computer and use it in GitHub Desktop.
Save saevarb/26705bb22f817c94608d to your computer and use it in GitHub Desktop.
i = 0
j = 0
for i in range(0, 10):
print((i % 2) * " ", end=" ")
for j in range(0, 4 - i % 2):
print((i % 2 + j * 2, 4 + j - i // 2), end=" ")
print()
# (0, 4) (2, 5) (4, 6) (6, 7)
# (1, 4) (3, 5) (5, 6)
# (0, 3) (2, 4) (4, 5) (6, 6)
# (1, 3) (3, 4) (5, 5)
# (0, 2) (2, 3) (4, 4) (6, 5)
# (1, 2) (3, 3) (5, 4)
# (0, 1) (2, 2) (4, 3) (6, 4)
# (1, 1) (3, 2) (5, 3)
# (0, 0) (2, 1) (4, 2) (6, 3)
# (1, 0) (3, 1) (5, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment