Skip to content

Instantly share code, notes, and snippets.

@messa
Last active December 24, 2015 14:19
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 messa/6811950 to your computer and use it in GitHub Desktop.
Save messa/6811950 to your computer and use it in GitHub Desktop.
Ortogonální pole 2^4 3^2
#!/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