Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Cipher Crossword solution in Uncategorized category for Cipher Crossword by capback250
# migrated from python 2.7
from itertools import permutations as p
from functools import reduce
def checkio(field, words):
_ = reduce(list.__add__, [x for x in field])
uzels = [x for x in _ if _.count(x) > 1 and x]
for mutable in p(words):
if sum([1 for i in range(3) for j, k in enumerate([0, 2, 4]) if mutable[i][k] == mutable[j + 3][i*2]]) == 9:
if all(len(set(fillMatrix(mutable)[i1][i2] for i1, k1 in enumerate(field) for i2, k2 in enumerate(k1) if k2 == uz)) == 1 for uz in uzels):
return fillMatrix(mutable)
def fillMatrix(new_str):
mtx = []
mtx.append(list(new_str[0]))
mtx.append([new_str[3][1], ' ', new_str[4][1], ' ',new_str[5][1]])
mtx.append(list(new_str[1]))
mtx.append([new_str[3][3], ' ',new_str[4][3], ' ',new_str[5][3]])
mtx.append(list(new_str[2]))
return mtx
Jan. 26, 2016