Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ericdill
Created April 20, 2019 02:16
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 ericdill/0c9aff06726f74efb70e702515a5a24c to your computer and use it in GitHub Desktop.
Save ericdill/0c9aff06726f74efb70e702515a5a24c to your computer and use it in GitHub Desktop.
num_tiles = 10
ret = []
for _ in range(num_tiles):
x0 = random.randint(0, source_size[0] - target_width)
y0 = random.randint(0, source_size[1] - target_height)
x1 = x0 + target_width
y1 = y0 + target_height
ret.append((x0, x1, y0, y1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment