Skip to content

Instantly share code, notes, and snippets.

@lheckemann
Last active March 7, 2016 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lheckemann/bb40cf1bf1cd90d20b4a to your computer and use it in GitHub Desktop.
Save lheckemann/bb40cf1bf1cd90d20b4a to your computer and use it in GitHub Desktop.
public static Stream<Coordinate> all() {
return IntStream.range(0, WIDTH*HEIGHT).mapToObj(i -> new Coordinate(i%WIDTH, i/WIDTH));
}
def all():
yield from ((i%WIDTH, i//WIDTH) for i in range(WIDTH*HEIGHT))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment