Skip to content

Instantly share code, notes, and snippets.

@matejker
Last active May 6, 2021 19:38
Show Gist options
  • Save matejker/8606d661d21885e27d0965e4c5553bff to your computer and use it in GitHub Desktop.
Save matejker/8606d661d21885e27d0965e4c5553bff to your computer and use it in GitHub Desktop.
def affine_lines(n: int) -> list:
return (
[[[x + ((t * x + u) % n) * n for x in range(n)] for u in range(n)] for t in range(0, n)] +
[[[x + y * n for y in range(n)] for x in range(n)]]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment