Last active
December 24, 2015 14:19
-
-
Save messa/6811950 to your computer and use it in GitHub Desktop.
Ortogonální pole 2^4 3^2
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
#!/usr/bin/env python | |
# -*- coding: UTF-8 -*- | |
tabulka = """ | |
000002 | |
011011 | |
101100 | |
110111 | |
011120 | |
100022 | |
11102 | |
01 11 | |
0010 | |
01 | |
12 | |
21 | |
""".strip().splitlines() | |
print tabulka | |
print len(tabulka) | |
values = [ | |
"01", | |
"01", | |
"01", | |
"01", | |
"012", | |
"012", | |
] | |
for a in range(6): | |
for b in range(6): | |
if a == b: | |
continue | |
for va in values[a]: | |
for vb in values[b]: | |
found = False | |
for row in tabulka: | |
if row[a] == va and row[b] == vb: | |
found = True | |
break | |
if not found: | |
raise Exception( | |
"Nenalezeno: hodnota %r ve sloupci %s " | |
"a hodnota %r ve sloupci %s" % ( | |
va, a+1, vb, b+1)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment