Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
chain and compress solution in Clear category for Cipher Map by pherapont
from itertools import chain, compress
def recall_password(grille, data):
cipfer_grille = [[l == 'X' for l in k] for k in grille] #boolean grille
first = list(compress(chain(*data), chain(*cipfer_grille))) #reading a value from a matrix
for i in range(3):
cipfer_grille = list(map(list, map(reversed, zip(*cipfer_grille)))) #the rotation of grille
first.extend(list(compress(chain(*data), chain(*cipfer_grille)))) #reading a value from a matrix
return "".join(first)
July 25, 2019