Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
argswhre + rot90 solution in 3rd party category for Cipher Map by LAyer_8
import itertools
from numpy import rot90
from numpy.core.numeric import argwhere
from numpy.ma.core import asarray
def recall_password(cipher_grille, ciphered_password):
s = ""
cipher = asarray([list(i) for i in cipher_grille])
cipher_pswd = asarray([list(i) for i in ciphered_password])
for _ in itertools.repeat(None, 4):
coords = (argwhere(cipher == 'X'))
for i in range(0, len(coords)):
s += cipher_pswd[coords[i][0]][coords[i][1]]
cipher = (rot90(cipher, 3))
return s
if __name__ == '__main__':
assert recall_password(
('X...',
'..X.',
'X..X',
'....'),
('itdf',
'gdce',
'aton',
'qrdi')) == 'icantforgetiddqd', 'First example'
assert recall_password(
('....',
'X..X',
'.X..',
'...X'),
('xhwc',
'rsqx',
'xqzz',
'fyzr')) == 'rxqrwsfzxqxzhczy', 'Second example'
March 28, 2017