Skip to content

Instantly share code, notes, and snippets.

@classmember
Last active October 12, 2025 02:52
Show Gist options
  • Save classmember/40ea859879b20dfe652c8eb8a5bd84a5 to your computer and use it in GitHub Desktop.
Save classmember/40ea859879b20dfe652c8eb8a5bd84a5 to your computer and use it in GitHub Desktop.
from itertools import product
get_tiles = lambda min_x, min_y, max_x, max_y: [ x for x in product(range(min_x, max_x+1), range(min_y, max_y+1)) ]
# get_tiles(*(2,2),*(4,4))
# [(2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (3, 4), (4, 2), (4, 3), (4, 4)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment