Created
December 2, 2018 11:39
-
-
Save dingosaurus/f581f9c7ea16bf7562faba74b48f58f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pprint | |
m = [(0, 0, 0, 0, 0), | |
(0, 0, 0, 0, 0), | |
(0, 0, 0, 0, 0), | |
(-1, 0, 0, 0, 0), | |
(-1, -1, 0, 0, 0),] | |
_x = len(m[0]) | |
_y = len(m) | |
out = [] | |
for x in range(1, _x+1): | |
out.append([(_x-x, y) for y in range(_y)]) | |
pprint.pprint(out) | |
#[[(4, 0), (4, 1), (4, 2), (4, 3), (4, 4)], | |
# [(3, 0), (3, 1), (3, 2), (3, 3), (3, 4)], | |
# [(2, 0), (2, 1), (2, 2), (2, 3), (2, 4)], | |
# [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4)], | |
# [(0, 0), (0, 1), (0, 2), (0, 3), (0, 4)]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment