Skip to content

Instantly share code, notes, and snippets.

@t-mart
Created October 21, 2015 15:09
Show Gist options
  • Save t-mart/9b083b3c25c756ce35fd to your computer and use it in GitHub Desktop.
Save t-mart/9b083b3c25c756ce35fd to your computer and use it in GitHub Desktop.
from itertools import combinations
UP = [[0,0,1,0,1,1,
1,1,1,1,0,1],
[1,0,1,0,1,0,
0,1,1,0,1,1]]
DOWN = [[0,1,1,0,0,1,
1,1,1,1,0,1],
[1,0,1,0,1,0,
0,1,0,0,0,1]]
LEFT = [[0,0,0,0,1,0,
1,0,0,1,1,1],
[0,0,0,0,1,0,
0,0,0,1,1,0]]
RIGHT = [[1,0,1,1,1,1,
1,1,1,0,1,0],
[1,0,1,1,0,0,
1,1,1,0,1,0]]
ALL = UP + DOWN + LEFT + RIGHT
r = range(0,12)
SEQUENCE_LENGTH = 4
for indexes in combinations(r, SEQUENCE_LENGTH):
selected = set()
for arr in ALL:
foo = tuple(arr[index] for index in indexes)
selected.add(foo)
if len(selected) == 8:
print(indexes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment